php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33548 php can't use relative path with iis6 and windows 2003
Submitted: 2005-07-02 15:06 UTC Modified: 2005-07-02 17:06 UTC
From: bigfaucet at yahoo dot com dot cn Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.10 OS: windows 2003 server
Private report: No CVE-ID: None
 [2005-07-02 15:06 UTC] bigfaucet at yahoo dot com dot cn
Description:
------------
While use relative path in php files, report error like this

Warning: main(./include/common.php): failed to open stream: No such file or directory in D:\www\bbs\index.php on line 19

when change to absolute path, works fine.

It happens where change server from windows 2000 server to windows 2003 server and iis5 to iis6


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-02 15:11 UTC] bigfaucet at yahoo dot com dot cn
the code course the errors include

require('./include/common.php');

fopen("include/config.inc.php");

...
 [2005-07-02 15:44 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #27891 

 [2005-07-02 17:06 UTC] bigfaucet at yahoo dot com dot cn
It seems while disabled ISAPI caching, "require" can use relative path.
 
but file function still not work.

the most simply test is like this 
DOCROOT
|
|-a.php
|-b.php

a.php
-----
<?php
$i = 1;
echo $i;
?>

b.php
-----
<?php
file("a.php"); 
?>

error_reporting's warning is on.
where visit b.php


Warning: file(a.php): failed to open stream: No such file or directory in D:\www\webroot\b.php on line 2
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC