linus72982 Posted July 17, 2010 Share Posted July 17, 2010 I've spent way too much time trying to decide why my script won't work all the sudden. It keeps telling me it can't find the require file - problem is, I changed nothing about the text that calls it or the file or the directory structure. Code is: require ("/php/facebook.php"); Very simple. I've gone into my directory and ensured it was named correctly and it was in the folder "php". It just doesn't make sense, it worked and then didn't without anything changing. Here's the error: Fatal error: require() [function.require]: Failed opening required '/php/facebook.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a2027775/public_html/index.php on line 2 Not sure if it is a symptom of the same problem, but I'm also having trouble with a few relative <a href>'s pointing to mydomain.com/mydomain.com/myfile.php and they are all just simple links that I've done 12,000 times before. I'm stumped. Thanks for any help. -Adam Quote Link to comment https://forums.phpfreaks.com/topic/208040-require-issue-its-correct-though/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 17, 2010 Share Posted July 17, 2010 Your script is in - /home/a2027775/public_html/index.php The require() statement you are using is attempting to access - /php/facebook.php A leading slash / on a file system path refers to the root of the current hard disk. Your code may have worked before, but not as written with the leading / on it. Quote Link to comment https://forums.phpfreaks.com/topic/208040-require-issue-its-correct-though/#findComment-1087502 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.