Bug 76974

Summary: Turning on safe_mode breaks php with apache 2
Product: [Retired] Red Hat Linux Reporter: Denice <deatrich>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-30 14:27:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Denice 2002-10-30 14:27:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
This is a known bug for apache 2.0 and PHP:
  http://bugs.php.net/bug.php?id=17858
It would be nice to have this bug fixed in the next patch cycle for PHP. As I
note a bit further down, there are also some problems with php directives which
do not work from within the apache configration files at php-4.2.2-8.0.5.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.change safe_mode to 'On' in /etc/php.ini
2.restart apache
3.open any php URL served by your website which comes from a properly moded php
file.
	

Actual Results:  Warning: SAFE MODE Restriction in effect. The script whose uid
is -1 is not allowed to access .....

Expected Results:  a correct php-generated web page

Additional info:

I grabbed a snapshot from http://snaps.php.net/ today: 
php4-STABLE-latest.tar.bz2 (which is named php4-STABLE-200210300000 in the
tarball) and rebuilt the rpm, taking note of the build bug reported at:
 http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=74819

This rebuilt version of php seems to function properly with apache 2, but I need
to do more testing. It also seems to fix some wierdness with php directives in a
virtual host context, as noted at:
 http://bugs.php.net/bug.php?id=17927

For example, the following kind of configuration works with this latest build I
did today, and does _not_ work with the php-4.2.2-8.0.5    rpm in RH 8.0:

    <IfModule sapi_apache2.c>
       php_admin_flag safe_mode  Off
       php_flag register_globals  On
       php_admin_value include_path "/var/www/myinc:."
       php_admin_flag allow_url_fopen  Off
       php_admin_flag file_uploads  On
       php_flag display_errors  On
    </IfModule>

Comment 1 Joe Orton 2002-11-01 14:26:30 UTC

*** This bug has been marked as a duplicate of 74396 ***