Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Dan Fulbright
November 29, 2005, 4:12 am
rate this thread
Files specified by include() or require() don't get included if the
filename begins with ./ (dot slash). phpMyAdmin uses this convention,
as I'm sure many other applications do. This works fine on several
other servers that I administer, although they are using PHP 4 as CGI.
Here's how I am reproducing the problem.
I have a file, includetest.php:
echo "include_path = " . get_include_path() . "<br />\n";
echo "Here is ./include.inc.php:<br />\n";
echo "Here is include.inc.php:<br />\n";
Here is include.inc.php, which is in the same directory:
This is the contents of include.inc.php<br />
Here are the results of running the script through PHP:
include_path = .;D:\PHP5\includes
Here is ./include.inc.php:
Warning: main(./include.inc.php) [function.main]: failed to open
stream: No such file or directory in c:\inetpub\wwwroot\includetest.php
on line 4
Warning: main() [function.include]: Failed opening './include.inc.php'
for inclusion (include_path='.;D:\PHP5\includes') in
c:\inetpub\wwwroot\includetest.php on line 4
Here is include.inc.php:
This is the contents of include.inc.php
As you can see, if I take the ./ away from the path it works fine.