newnewbie Posted March 8, 2010 Share Posted March 8, 2010 Ok...this is my first post to any forum...ever. I am a true beginner. I continue to get this error whenever the file "tpl_unsecure.php" is required...everytime, no matter what file it is required in. The path is absolutey correct. And yes ths is practice from a PHP book I am reading. Error: Warning: require_once(../_lib/_base/elements.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\site\tpl_unsecure.php on line 5 Fatal error: require_once() [function.require]: Failed opening required '../_lib/_base/elements.php' (include_path='.;C:\Program Files (x86)\PHP\pear;\C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\_lib\_base;\C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\_lib\_classes;\C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\site\;C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\core\;C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\_img\;C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\_lib\_base\') in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\site\tpl_unsecure.php on line 5 Code: // get the tpl_unsecure.php file that has the needed // functions for the rest of this page require_once('../tpl_unsecure.php'); require_once('../../_lib/_classes/class.products.php'); The path is in my php.ini file. And "elements.php" runs fine. I have even had a second pair of eyes look at the path to make sure I wasn't going crazy! Thanks for any help you pros can provide! "There were no stupid questions...or at least until now." Quote Link to comment Share on other sites More sharing options...
ferdi Posted March 8, 2010 Share Posted March 8, 2010 Try using the absolute path(exact path on your HDD). require('C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Book DVD Life\_base/elements.php'); Just, also as a side note, make a script that echo's the "cwd()" function, might be something wrong with your PHP configuration. Quote Link to comment Share on other sites More sharing options...
newnewbie Posted March 8, 2010 Author Share Posted March 8, 2010 Okay, I tried the absolute path with no luck. Like I said, a real newb here. Can you explain "cwd()" and a brief explanation of the code that I should write to check this. I assume this is some sort of directory check? Thanks! Quote Link to comment Share on other sites More sharing options...
ferdi Posted March 8, 2010 Share Posted March 8, 2010 I really don't know what could be wrong then. Just make sure the files are there, it has to work. About cwd(), read up on it at php.net/cwd 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.