Reply to include and require not working with ./ in Windows

Your name:

Reply:


Posted by Dan Fulbright on 11/29/05 06:12

I'm using PHP 5.0.5 as an ISAPI module on IIS 6, Windows Server 2003.

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:

<?php
echo "include_path = " . get_include_path() . "<br />\n";
echo "Here is ./include.inc.php:<br />\n";
include('./include.inc.php');
echo "Here is include.inc.php:<br />\n";
include('include.inc.php');
?>

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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация