Jump to content

require issue, it's correct though...


linus72982

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/208040-require-issue-its-correct-though/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.