include and require not working with ./ in Windows



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.

.



Relevant Pages

  • Re: Executing a locally installed program in IIS 6
    ... it appears that PHP requires enabling a security ... function needs CMD.EXE to have weak ACLs and accessible via IIS -- something ... we explicitly denied with IIS6 on Windows Server 2003). ...
    (microsoft.public.inetserver.misc)
  • RE: [PHP] reading excell and writing to text file..
    ... Are you using a windows server? ... [PHP] reading excell and writing to text file.. ... I was wondering a good place I could get started on reading excel ... I could take a XLS file with php and read it, ...
    (php.general)
  • Run PHP-Script in Background
    ... I am using php 5.0.4 under IIS 6 under Windows Server 2003 and want to ... This schript dies not have any ... Dealing with other variants of php cli procesors like php-win.exe gave ...
    (comp.lang.php)
  • Re: Recommended Windows Hosts
    ... I didn't really want to mix the two...I was just wondering if php could run on windows server. ... | "Jim Cheshire" wrote in message ... Jimco is ...
    (microsoft.public.frontpage.client)
  • Re: Looking for e-commerce recommendations
    ... The only reason that I am considering PHP (although my level is at "Hello ... > I would generally stay with .asp on a windows server unless there was a ... > script that was very close to what I needed and there was no .asp ... >> Some Hosts do not install PHP or Perl on Windows servers, ...
    (microsoft.public.frontpage.programming)