From:             tim at digicol dot de
Operating system: Red Hat 7.3 (Linux 2.4.18-3)
PHP version:      4.3.3RC1
PHP Bug Type:     Scripting Engine problem
Bug description:  $DOCUMENT_ROOT and $PHP_SELF not set (Apache 1.3)

Description:
------------
My PHP is compiled statically into Apache 1.3.27:
./configure --with-mysql --with-oracle --with-oci8 --enable-sigchild
--with-db3 --with-ldap --with-zlib --with-gd
--with-mcrypt=/usr/local/libmcrypt-2.5.7 --with-curl=/usr/local
--with-apache=/usr/local/apache_1.3.27

In PHP 4.3.3RC1, the variables $DOCUMENT_ROOT and $PHP_SELF seem to have
disappeared completely, even if register_globals is on.

Accessing these variables through $_SERVER or $HTTP_SERVER_VARS works
fine.

In PHP 4.3.2 (and - to my knowledge - in all previous 3.x and 4.x
versions), $DOCUMENT_ROOT and $PHP_SELF are there as long as
register_globals is on.

This breaks backwards compatibility quite awfully. Any chance that this
change will be reverted? (If not, please at least make a big note in the
NEWS/ChangeLog...)

I'm no C programmer and I don't understand what's going on there, but I
saw that php4/main/php_variables.c had been changed...

Reproduce code:
---------------
register_globals: "<?=ini_get('register_globals')?>"
$PHP_SELF: "<?=$PHP_SELF?>"
$_SERVER[ PHP_SELF ]: "<?=$_SERVER[ 'PHP_SELF' ]?>"
$DOCUMENT_ROOT: "<?=$DOCUMENT_ROOT?>"
$_SERVER[ DOCUMENT_ROOT ]: "<?=$_SERVER[ 'DOCUMENT_ROOT' ]?>"


Expected result:
----------------
register_globals: "1"
$PHP_SELF: "/test.php"
$_SERVER[ PHP_SELF ]: "/test.php"
$DOCUMENT_ROOT: "/home/www"
$_SERVER[ DOCUMENT_ROOT ]: "/home/www"

Actual result:
--------------
register_globals: "1"
$PHP_SELF: ""
$_SERVER[ PHP_SELF ]: "/test.php"
$DOCUMENT_ROOT: ""
$_SERVER[ DOCUMENT_ROOT ]: "/home/www"

-- 
Edit bug report at http://bugs.php.net/?id=24253&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24253&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24253&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24253&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24253&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24253&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24253&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24253&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24253&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24253&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24253&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24253&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24253&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24253&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24253&r=gnused

Reply via email to