Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.