pear includes
Posted by: redwax (---.dsl.pipex.com)
Date: March 10, 2007 10:56AM

I am getting an error when I call require_once('DB.php');

This is the error I get:

Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in O:\WEBSITESandGRAPHICS\phpstudy\test.php on line 4

Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;C:\php5\pear') in O:\WEBSITESandGRAPHICS\phpstudy\test.php on line 4

line 4 is: require_once('DB.php');

php.ini can be found @ [redwax.co.uk] which shows the include path as it should be. I can't find any reference anywhere in any file to C:\php5\pear so I am totally stumped as to what is happening.

Thank you for your help

Options: ReplyQuote
Re: pear includes
Posted by: CyberSpatium (71.237.217.---)
Date: March 10, 2007 06:48PM

where is your document root located (check DocumentRoot setting in your apache http.conf config file)?



CyberSpatium
----------------------
WAMP English Forum Admin

Options: ReplyQuote
Re: pear includes
Posted by: redwax (---.dsl.pipex.com)
Date: March 13, 2007 07:03PM

DocumentRoot "O:\WEBSITESandGRAPHICS"

Options: ReplyQuote
Re: pear includes
Posted by: CyberSpatium (71.237.217.---)
Date: March 13, 2007 08:27PM

require_once ('/phpstudy/test.php');


CyberSpatium
----------------------
WAMP English Forum Admin

Options: ReplyQuote
Re: pear includes
Posted by: willbro (---.spl.org)
Date: April 18, 2007 12:54AM

I've had the same issue. I get around it with an include rather than a require
.
Adding the subdirectory's to the require statement did not change anything.

My doc root had forward slashes instead of back slashes... does that make a difference?

Options: ReplyQuote
Re: pear includes
Posted by: CyberSpatium (71.237.217.---)
Date: April 18, 2007 01:58AM

there is no difference between include() and require() except how they return errors if the file being included cannot be found

if an error happens with require(), it returns a fetal error and halts the script

if an error happens with include() will cause a warning, but will not stop execution.

[www.php.net]



CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!

Please visit my latest website Clarify Loans:
clarifyloans.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.