PDA

View Full Version : auto_prepend_file ...is looking where?


mothra
09-18-2009, 09:03 PM
I really have not done much Apache config of any sort. I'm trying to use auto_prepend_file for the first time in .htaccess

Right now I'm just working on my local machine. I provided a relative path hoping that it would prepend the file in that location but Apache cannot find the file and is giving me the following msg...


Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required '/beta/test.php' (include_path='.;C:\php5\pear') in Unknown on line 0


My code in .htaccess:

php_value auto_prepend_file /beta/test.php



Do I need to configure Apache to look in my web root for the file(s) to prepend? Is this something I can override in .htaccess? I would hope I don't need to supply an absoulte path... I have no idea what the server directory structure is other than from my web root down of course.

Any suggestions are appreciated.

Inigoesdr
09-19-2009, 07:50 PM
It's looking for the literal path of the file, and then looking in the include path(s). The file exists in neither, so you get the error. You do in fact need to specify an absolute path. If you place a phpinfo file in your web root, and view it you will be able to find the path. Alternatively you can do something like this:
<?php
echo dirname(__FILE__);
?>