From:             [EMAIL PROTECTED]
Operating system: mac osx
PHP version:      4.3.0RC4
PHP Bug Type:     Other web server
Bug description:  $_SERVER[PHP_SELF] empty in cgi 

<?php
print_r($_SERVER);
?>

returns:

22:28:26(george@ool-18bced28)[~/Advanced PHP/examples]> php 
a.php               
Content-type: text/html                                                   
     
X-Powered-By: PHP/4.3.0-dev                                               
     
                                                                          
     
Array                                                                     
     
(                                                                         
     
    [HOME] => /Users/george                                               
     
    [SHELL] => /bin/tcsh                                                  
     
    [USER] => george                                                      
     
    [LANG] => en                                                          
     
    [PATH] => /sw/bin:/sw/sbin:/bin:/usr/bin:/Users/george/
bin:/usr/sbin:/opt/GN
Upgcc/bin:/opt/GNUxemacs/bin:/usr/local/bin:/usr/local/
sbin:/usr/openwin/bin:/us
r/dt/bin:/usr/ccs/bin:/usr/proc/bin:/usr/ucb:/usr/X11R6/
bin:/sw/bin:/sw/sbin:.:/
usr/X11R6/bin                                                             
     
    [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0                                
     
    [TERM] => vt100                                                       
     
    [PWD] => /Users/george/Advanced PHP/examples                          
     
    [HOSTTYPE] => macintosh                                               
     
    [VENDOR] => apple                                                     
     
    [OSTYPE] => darwin                                                    
     
    [MACHTYPE] => powerpc                                                 
     
    [SHLVL] => 1                                                          
     
    [LOGNAME] => george                                                   
     
    [GROUP] => staff                                                      
     
    [HOST] => ool-18bced28.dyn.optonline.net                              
     
    [HOSTTAG] => maya [Omniti/mobile]                                     
     
    [MANPATH] => /usr/share/man:/usr/openwin/share/man:/
usr/man:/usr/local/man:/
opt/SUNWwabi/man:/usr/local/lib/perl5/man:/opt/GNUpgcc/
man:/opt/GNUxemacs/man   
    [INFOPATH] => /sw/share/info:/sw/info:/usr/local/share/
info:/usr/local/lib/i
nfo:/usr/local/info:/usr/share/info                                       
     
    [PERL5LIB] => /sw/lib/perl5                                           
     
    [EDITOR] => vi                                                        
     
    [VISUAL] => vi                                                        
     
    [DISPLAY] => :0.0                                                     
     
    [CVS_RSH] => ssh                                                      
     
    [OPENWINHOME] => /usr/openwin                                         
     
    [XFILESEARCHPATH] => /usr/dt/lib/%T/%N%S                              
     
    [XGLHOME] => /opt/SUNWits/Graphics-sw/xgl                             
     
    [LD_LIBRARY_PATH] => /usr/lib:/usr/dt/lib:/usr/openwin/
lib:/usr/ucblib:/usr/
local/lib:.                                                               
     
    [XILHOME] => /opt/SUNWits/Graphics-sw/xil                             
     
    [MOTIFHOME] => /usr/dt                                                
     
    [UIDPATH] => /opt/SUNWmfdm                                            
     
    [XMBINDDIR] => /usr/dt/lib/bindings                                   
     
    [GUIDEHOME] => /opt/SUNWguide                                         
     
    [PHP_SELF] =>                                                         
     
    [argv] => Array                                                       
     
        (                                                                 
     
            [0] => a.php                                                  
     
        )                                                                 
     
                                                                          
     
    [argc] => 1                                                           
     
)         

note PHP_SELF is unset.  Running the same under cli yields 
correct result:

22:31:00(george@ool-18bced28)[~/Advanced PHP/examples]> ~/
src/php4-STABLE-200212
210230/sapi/cli/php ~/Advanced\ PHP/examples/a.php                        
     
Array                                                                     
     
(                                                                         
     
    [HOME] => /Users/george                                               
     
    [SHELL] => /bin/tcsh                                                  
     
    [USER] => george                                                      
     
    [LANG] => en                                                          
     
    [PATH] => /sw/bin:/sw/sbin:/bin:/usr/bin:/Users/george/
bin:/usr/sbin:/opt/GN
Upgcc/bin:/opt/GNUxemacs/bin:/usr/local/bin:/usr/local/
sbin:/usr/openwin/bin:/us
r/dt/bin:/usr/ccs/bin:/usr/proc/bin:/usr/ucb:/usr/X11R6/
bin:/sw/bin:/sw/sbin:.:/
usr/X11R6/bin                                                             
     
    [__CF_USER_TEXT_ENCODING] => 0x1F5:0:0                                
     
    [TERM] => vt100                                                       
     
    [PWD] => /Users/george/Advanced PHP/examples                          
     
    [HOSTTYPE] => macintosh                                               
     
    [VENDOR] => apple                                                     
     
    [OSTYPE] => darwin                                                    
     
    [MACHTYPE] => powerpc                                                 
     
    [SHLVL] => 1                                                          
     
    [LOGNAME] => george                                                   
     
    [GROUP] => staff                                                      
     
    [HOST] => ool-18bced28.dyn.optonline.net                              
     
    [HOSTTAG] => maya [Omniti/mobile]                                     
     
    [MANPATH] => /usr/share/man:/usr/openwin/share/man:/
usr/man:/usr/local/man:/
opt/SUNWwabi/man:/usr/local/lib/perl5/man:/opt/GNUpgcc/
man:/opt/GNUxemacs/man   
    [INFOPATH] => /sw/share/info:/sw/info:/usr/local/share/
info:/usr/local/lib/i
nfo:/usr/local/info:/usr/share/info                                       
     
    [PERL5LIB] => /sw/lib/perl5                                           
     
    [EDITOR] => vi                                                        
     
    [VISUAL] => vi                                                        
     
    [DISPLAY] => :0.0                                                     
     
    [CVS_RSH] => ssh                                                      
     
    [OPENWINHOME] => /usr/openwin                                         
     
    [XFILESEARCHPATH] => /usr/dt/lib/%T/%N%S                              
     
    [XGLHOME] => /opt/SUNWits/Graphics-sw/xgl                             
     
    [LD_LIBRARY_PATH] => /usr/lib:/usr/dt/lib:/usr/openwin/
lib:/usr/ucblib:/usr/
local/lib:.                                                               
     
    [XILHOME] => /opt/SUNWits/Graphics-sw/xil                             
     
    [MOTIFHOME] => /usr/dt                                                
     
    [UIDPATH] => /opt/SUNWmfdm                                            
     
    [XMBINDDIR] => /usr/dt/lib/bindings                                   
     
    [GUIDEHOME] => /opt/SUNWguide                                         
     
    [PHP_SELF] => /Users/george/Advanced PHP/examples/a.php               
     
    [SCRIPT_NAME] => /Users/george/Advanced PHP/examples/
a.php                  
    [SCRIPT_FILENAME] => /Users/george/Advanced PHP/
examples/a.php              
    [PATH_TRANSLATED] => /Users/george/Advanced PHP/
examples/a.php              
    [DOCUMENT_ROOT] =>                                                    
     
    [argv] => Array                                                       
     
        (                                                                 
     
            [0] => /Users/george/Advanced PHP/examples/
a.php                    
        )                                                                 
     
                                                                          
     
    [argc] => 1                                                           
     
)   


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

Reply via email to