Jump to content

Failed to Open Stream....you've probably seen this before...


Recommended Posts

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."

Link to comment
Share on other sites

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.

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.