Bug #17551 Updated: PHP4.10 and PHP4.20 includes different files when calling include_once()
| From: | ulysses at mail dot fitan dot com dot tw | Date: | Tue, 04 Jun 2002 01:34:41 +0000 |
| Subject: | Bug #17551 Updated: PHP4.10 and PHP4.20 includes different files when calling include_once() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9408@lists.php.net to get a copy of this message | ||
ID: 17551
Updated by: ulysses@mail.fitan.com.tw
Reported By: ulysses@mail.fitan.com.tw
-Status: Bogus
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Windows 2000 (IIS5.0)
PHP Version: 4.2.0
New Comment:
Thank you. I'll ask for support.
Previous Comments:
------------------------------------------------------------------------
[2002-06-03 07:01:55] mfischer@php.net
And hera again the same with IIS/CGI (the former was from the command
line). There's no difference, I suspect this being a configuration
problem with your system, please ask for support at
php-general@lists.php.net
4.0.6
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
4.1.0
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
4.1.1
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
4.1.2
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm WRONG c.php (c:\inetpub\wwwroot\php\test\inc\cls\c.php)
4.2.0
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
4.2.1
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
4.3.0-dev
I'm a.php (c:\inetpub\wwwroot\php\test\a.php)
I'm b.php (c:\inetpub\wwwroot\php\test\inc\b.php)
I'm CORRECT c.php (c:\inetpub\wwwroot\php\test\cls\c.php)
------------------------------------------------------------------------
[2002-06-03 06:18:26] mfischer@php.net
Works as expected for me (though 4.1.2 seems to be broken):
4.0.6
I'm a.php (a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
4.1.0
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
4.1.1
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
4.1.2
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm WRONG c.php (C:\Inetpub\wwwroot\php\test\inc\cls\c.php)<br />
4.2.0
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
4.2.1
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
4.3.0-dev
I'm a.php (C:\Inetpub\wwwroot\php\test\a.php)<br />
I'm b.php (C:\Inetpub\wwwroot\php\test\inc\b.php)<br />
I'm CORRECT c.php (C:\Inetpub\wwwroot\php\test\cls\c.php)<br />
------------------------------------------------------------------------
[2002-06-02 23:15:42] ulysses@mail.fitan.com.tw
I am not playing with PHP. It my job and I am developing a
Stock-MRP-Accounting system for my client and I have
problems switching from 4.10 to 4.20. Maybe I should
describe the real situation to you.
I have these files:
c:/inetpub/wwwroot/stock/stock_amend.php
c:/inetpub/wwwroot/stock/edit/stock_amend.approve.php
c:/inetpub/wwwroot/stock/class/notification.class.php
1. The stock_amend.php is the main entrance. When user
invoke stock_amend.php with POST, stock_amend.php will
call:
include_once('edit/stock_amend.approve.php')
to execute authorization and data modifications.
2. In edit/stock_amend.approve.php program will
conditionally calling
include_once('class/notification.class.php');
to make logs.
Now the problem is, these codes works fine on my developing
platform (PHP4.10), but they failed to work on my client's
server (PHP4.20). I've got this message:
Warning: Failed opening 'class/notification.class.php' for
inclusion (include_path='c:\php4\pear') in c:/inetpub/
wwwroot/stock/edit/stock_amend.approve.php
on line 105
Now I rewrite my experimental codes:
c:/inetpub/wwwroot/test/a.php
c:/inetpub/wwwroot/test/inc/b.php
c:/inetpub/wwwroot/test/cls/c.php
c:/inetpub/wwwroot/test/inc/cls/c.php
test/a.php:
<?
echo "<BR>I'm a.php (".__FILE__.")";
include_once("inc/b.php");
?>
test/inc/b.php:
<?
echo "<BR>I'm b.php (".__FILE__.")";
include_once("cls/c.php");
?>
test/cls/c.php:
<?
echo "<BR>I'm CORRECT c.php (".__FILE__.")";
?>
test/inc/cls/c.php:
<?
echo "<BR>I'm WRONG c.php (".__FILE__.")";
?>
PHP 4.10 shows this result:
I'm a.php (c:/inetpub/wwwroot/test/a.php)
I'm b.php (c:/inetpub/wwwroot/test/inc/b.php)
I'm CORRECT c.php (c:/inetpub/wwwroot/test/cls/c.php)
But PHP4.20 shows this result:
I'm a.php (c:/inetpub/wwwroot/test/a.php)
I'm b.php (c:/inetpub/wwwroot/test/inc/b.php)
I'm WRONG c.php (c:/inetpub/wwwroot/test/inc/cls/c.php)
Of course I know that I can use full path in include_once()
to prevent this problem. The point is: PHP4.10 AND PHP4.20
DID INCLUDE DIFFERENT FILES AND I AM NOT TALKING ABOUT
__FILE__. There is nothing wrong with __FILE__ in 4.10 and
4.20. They all present the correct file path.
------------------------------------------------------------------------
[2002-06-01 09:39:02] sniper@php.net
For me it looks like 4.2.x works as expected.. __FILE__
outputs the correct path there.
------------------------------------------------------------------------
[2002-06-01 09:38:56] sniper@php.net
For me it looks like 4.2.x works as expected.. __FILE__
outputs the correct path there.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/17551
--
Edit this bug report at http://bugs.php.net/?id=17551&edit=1