From:             maddog2k at maddog2k dot net
Operating system: Linux
PHP version:      4.4.1
PHP Bug Type:     Apache2 related
Bug description:  safe-mode errors with multiple include virtual requests

Description:
------------
This is somewhat a copy of bug #35029 (segmentation faults with multiple
include virtual requests).

The problem here is that at least with php4-STABLE-200511160748 (combined
with at least Apache 2.0.54/.55) either it segfaults or a safe_mode error
pops up.

This has worked in PHP 4.4.0 and below with same Apache-versions...

Here are the conditions:

.shtml page with 1 or more .php includes : OK
.shtml page with 1 or more .html includes : OK
.shtml page with 1 or more .php includes and 1 or more .html includes :
ERROR, but ONLY if the .html appears as first include (thus before the
first .php include).

If the .html is placed after the first .php include, no errors show (see:
Actual result)
However, if I place a .cgi above the first .php, no problem occurs either
for some strange reason.

Also, the UID mentioned by the PHP message occasionaly differs, and is
NEVER the actual UID... looks like some process mixup or so. (UID 978
mentioned changes sometimes, and UID 1027 is the actual UID).

But, as mentioned, you don't get PHP warning but the Apache child process
just exists with Segmentation fault (11).

Tried this on a lot (> 10) of machines.

Reproduce code:
---------------
test.shtml:

<html>
<body>
<!--#include virtual="/t1.html" -->
<!--#include virtual="/t1.php" -->
<!-- optionally more virtuals //-->
</body>
</html>

t1.html:
<pre>TEST1-HTML</pre>
<br>

t1.php:
<?php
print "TEST1-PHP\n<br>\n";
?>

Expected result:
----------------
<html>
<body>
OUTPUT_OF: /t1.html
OUTPUT_OF: /t1.php
</body>
</html>

Actual result:
--------------
<html>
<body>
OUTPUT OF: /t1.html

Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid
is 978 is not allowed to access /opt/guide/www.some-domain.nl/HTML/t1.php
owned by uid 1027 in Unknown on line 0

Warning: Unknown/opt/guide/www.some-domain.nl/HTML/t1.php): failed to open
stream: No such file or directory in Unknown on line 0

Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid
is 978 is not allowed to access /opt/guide/www.some-domain.nl/HTML/t1.php
owned by uid 1027 in Unknown on line 0

Warning: Unknown(/opt/guide/www.some-domain.nl/HTML/t1.php): failed to
open stream: No such file or directory in Unknown on line 0

Warning: (null)(): Failed opening
'/opt/guide/www.some-domain.nl/HTML/t1.php' for inclusion
(include_path='.:/usr/local/php4/lib/php') in Unknown on line 0


---
With segfault: [Thu Nov 17 15:22:57 2005] [notice] child pid 20071 exit
signal Segmentation fault (11)

-- 
Edit bug report at http://bugs.php.net/?id=35264&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35264&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35264&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35264&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35264&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35264&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35264&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35264&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35264&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35264&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35264&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35264&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35264&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35264&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35264&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35264&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35264&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35264&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35264&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35264&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35264&r=mysqlcfg

Reply via email to