'include not found
my include is not being accessed. the apache error log tells me:
"PHP Warning: include(db.inc.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11"
I don't understand why it appears to be looking for the include file in the page i'm calling it from rather than the directory holding all my php files.
"PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'db.inc.php' for inclusion (include_path='.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11
I reckon it must be a setup problem in my ini file because this never happened before with my previous setup.
Also, why does it refer to pear when i don't think i use that.
thanks in advance, feeling a bit stupid,
try to change to:
restart the server.
require gets me:
PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'db.inc.php' (include_path='.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11
why is my include_path going to pear, though. is that the problem. should i disable pear?
try using the full local path to the include.
the include path should point to two include paths
one for pear for pear include files
second the normal include path
you have to create the includes directory in C:\php5
changed the ini file restarted server, getting same fatal error referring to pear.
post your include configuration in php.ini
be sure the file is in the same directory where your php file is or the include path is correct
or in the includes directory in C:\php5
config is now pointing to c:\php\includes. makes no difference. have searched ini file for any reference to pear path without success. if i shift my include file from my site root then what would i do once i put the site onto my host? still don't undersdtand why this worked on my other pc Just checked the config on my other pc and the include_path isn't even de-commented. very odd.
tried full path, arkinstall, and still not found.
Just to check - What are the permissions on the file?
how do i check that? sorry..
Does the file even exist at the location you want?
Ie does db.inc.php exist at this location:
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xxxxxx\db.inc.php
Also since you are on Windows, there is no permission settings.
to system advanced anvironment variables system variables path
at the end of the variable value
restart the system
now the include path should work
If that is a pear package you will also need the directory where your pear files were downloaded to in your environmental path. As per ernies post, you should already have php in your path. You will need to follow the above advice and add the pear binaries path.
logic earth - yep, it exists on that path.
to all - don't b distracted by me going on about pear. i just don't understand why pear is being referred to in the error message at all.
this is the first time i've used apache rather than iis. could that be something to do with it? is there a default path? because i did not create any directory c:php5.
in the past i had no problem with my includes being in the same dir as my php pages. perhaps since apache is used so much with **nux they expect me to use a separate dir for includes?