PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Enable display_errors and set error_reporting to -1. Then try including with $required=true.
Also, $localPath isn't available inside the function. Which won't actually make any difference (besides the possible undefined variable warning) because require/include use the CWD anyways.