phpnewone Posted November 22, 2010 Share Posted November 22, 2010 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? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 22, 2010 Share Posted November 22, 2010 It would seem you incorrectly specified the new path. Quote Link to comment Share on other sites More sharing options...
phpnewone Posted November 22, 2010 Author Share Posted November 22, 2010 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! Quote Link to comment Share on other sites More sharing options...
btherl Posted November 22, 2010 Share Posted November 22, 2010 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. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 22, 2010 Share Posted November 22, 2010 There's only one reason I can think of for that error: the require()d file isn't found by the script. Either the file doesn't exist, or the path is wrong. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 22, 2010 Share Posted November 22, 2010 i don't know windows php. is windows php okay with ../../../ ? i suspect so, but thought i'd throw it out there... Quote Link to comment Share on other sites More sharing options...
phpnewone Posted November 22, 2010 Author Share Posted November 22, 2010 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] Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 22, 2010 Share Posted November 22, 2010 i think you have one too many .. require('../../data/MoStopsDEV/ConnectionStrings.php'); Quote Link to comment Share on other sites More sharing options...
phpnewone Posted November 22, 2010 Author Share Posted November 22, 2010 It's still inside the www folder. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 22, 2010 Share Posted November 22, 2010 sorry, updated my reply. i think you have one too many .. and it should be require_once('../../data/MoStopsDEV/ConnectionStrings.php'); Quote Link to comment Share on other sites More sharing options...
phpnewone Posted November 22, 2010 Author Share Posted November 22, 2010 WHen I remove ../, I get an error that the file isn't found. Also, this code worked before I moved the page that calls the query. Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted November 22, 2010 Share Posted November 22, 2010 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. Quote Link to comment 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.