Jump to content

require_once error


phpnewone

Recommended Posts

I have a page that was working perfectly.  I decided to move that page.  Once I did that, I changed my require_once statement to reflect that the page had moved.  Although the paths seem correct, I am getting this error:

 

require_once() [<a href='function.require'>function.require</a>]: Failed opening required '../../../data/MoStopsDEV/ConnectionStrings.php' (include_path='.;C:\Program Files\Jcx.Software\VS.Php\2008\php 5\pear;C:\Program Files\Jcx.Software\VS.Php\2008\')

 

I researched this error but am not able to find anything helpful.

 

Any ideas?

Link to comment
Share on other sites

I don't think that's the problem.

 

The page (charity_search.php) that I moved calls a query (CharityQueries.php) which calls the connection string (ConnectionStrings.php).  The only thing I changed was moving the file charity_search.php and then the require_once path of the CharityQueries.  I did not move CharityQueries which is why I can't understand why the error isn't thrown until CharityQueries was calling the ConnectionString.

 

Thanks!

 

 

Link to comment
Share on other sites

It's difficult to advise you with that much information.  Is moving that one file and changing one require_once() line the ONLY things you did, after the last time you tested that that script was working?

 

Otherwise, if you give us the locations of each file involved and the lines being used to include each file then we might be able to see what's going wrong.

Link to comment
Share on other sites

The only thing I changed was moving the file from the Pages folder to outside of it, and changing the require_once statement like so:

 

require_once('../Queries/CharityQueries.php');

to

require_once('Queries/CharityQueries.php');

 

I attached a screenshot of the location of these files.

 

Thanks!

 

 

***Sorry, don't know why my screenshot didn't come through.

 

[attachment deleted by admin]

Link to comment
Share on other sites

did you move the page calling the query up one directory? if so, you would need to remove one set of ../

 

another idea, but don't know why this would have changed: check the permissions on the required file

 

another idea: use an absolute path to the required file instead of a relative path.

Link to comment
Share on other sites

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.