php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50102 With CGI/FastCGI, auto_prepend_file and auto_append_file duplication.
Submitted: 2009-11-06 15:03 UTC Modified: 2009-11-07 20:38 UTC
From: RQuadling at GMail dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.3SVN-2009-11-06 (snap) OS: Windows XP SP3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: RQuadling at GMail dot com
New email:
PHP Version: OS:

 

 [2009-11-06 15:03 UTC] RQuadling at GMail dot com
Description:
------------
Hi.

I have a script D:\PHP\Includes\auto_loader.php

My include_path=C:\PHP5\PEAR;D:\PHP\Includes;.

My auto_prepend_file=auto_loader.php

For this bug report, I've also set auto_append_file=show_includes.php

At the CLI, all is well.

Via CGI-FastCGI (I'm using IIS7, but I can replicate the issue via the 
commandline using php-cgi.exe), I get an extra entries.

Using ...
CD C:\
C:\PHP5\php.exe
C:\PHP5\php-cgi.exe

and pressing CTRL+Z (or F6) and then ENTER to leave PHP reveals the 
issue.

Interestingly, if I use ...

C:\PHP5\php-cgi -n -d 
auto_prepend_file=D:\PHP\Includes\auto_loader.php -d 
auto_append_file=D:\PHP\Includes\show_includes.php, then all is 
well.

So it seems reading the ini file and processing the 
auto_append_file/auto_prepend_file entries causes the issue. Maybe. It 
looks that way.

Reproduce code:
---------------
--------auto_loader.php
<?php
// Nothing needed here. All my code removed.
?>

-------show_includes.php
<?php
print_r(get_included_files());
?>

Expected result:
----------------
Array
(
    [0] => C:\-
    [1] => D:\PHP\Includes\auto_loader.php
    [2] => D:\PHP\Includes\show_includes.php
)

Array
(
    [0] => C:\-
    [1] => D:\PHP\Includes\auto_loader.php
    [2] => D:\PHP\Includes\show_includes.php
)

Actual result:
--------------
Array
(
    [0] => C:\-
    [1] => D:\PHP\Includes\auto_loader.php
    [2] => D:\PHP\Includes\show_includes.php
)

X-Powered-By: PHP/5.3.2-dev
Content-type: text/html; charset=UTF-8

Array
(
    [0] => C:\-
    [1] => C:\auto_loader.php
    [2] => D:\PHP\Includes\auto_loader.php
    [3] => C:\show_includes.php
    [4] => D:\PHP\Includes\show_includes.php
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-06 15:38 UTC] rquadling@php.net
Argh.

Bug in Microsoft's Wincache.
 [2009-11-06 15:39 UTC] rquadling@php.net
Bug in wincache which only affects CGI SAPI.
 [2009-11-06 15:51 UTC] rquadling@php.net
C:\PHP5\php-cgi -n -d extension_dir=C:\PHP5\ext -d 
include_path=".;C:\PHP5\PEAR;D:\PHP\Includes" -d 
auto_prepend_file=auto_loader.php -d auto_append_file=show_includes.php 
-d extension=php_wincache.dll

vs

C:\PHP5\php-cgi -n -d extension_dir=C:\PHP5\ext -d 
include_path=".;C:\PHP5\PEAR;D:\PHP\Includes" -d 
auto_prepend_file=auto_loader.php -d auto_append_file=show_includes.php 
-d

shows the issue. But only with CGI/FastCGI.
 [2009-11-07 19:27 UTC] ksingla@php.net
I couldn't repro it with WinCache v1 RC. Looks like its already fixed.
 [2009-11-07 20:38 UTC] pajoye@php.net
PECL extensions bugs must be reported to pecl.php.net, not in bugs.php.net.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC