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
https://forums.phpfreaks.com/topic/219507-require_once-error/
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
https://forums.phpfreaks.com/topic/219507-require_once-error/#findComment-1138099
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
https://forums.phpfreaks.com/topic/219507-require_once-error/#findComment-1138104
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
https://forums.phpfreaks.com/topic/219507-require_once-error/#findComment-1138129
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
https://forums.phpfreaks.com/topic/219507-require_once-error/#findComment-1138143
Share on other sites

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.