ID:               26429
 Updated by:       [EMAIL PROTECTED]
 Reported By:      skissane at ics dot mq dot edu dot au
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: Linux
 PHP Version:      4.3.4
 New Comment:

The docs should be modified to reflect the fact that all server
variables except PHP_SELF, argc and argv are set by the web server and
PHP has absolutely no control over their values.  While Apache sets
them to one thing, another server may set them to another, and there
may be differences between the server module version and the CGI
interface to any of these web servers.


Previous Comments:
------------------------------------------------------------------------

[2003-11-26 23:50:28] skissane at ics dot mq dot edu dot au

Description:
------------
According to the documentation:
'SCRIPT_FILENAME'
The absolute pathname of the currently executing script. 

But, when I do 'echo $_SERVER["SCRIPT_FILENAME"]', using PHP-CLI, I get
a pathname relative to the current directory.

So either the docs are wrong, or the code is buggy (suggest that
documented behaviour is more useful than actual behaviour, hence code
should be changed.)

(Despite what the form forced me to say above, I'm actually using
4.3.4RC1, not 4.3.4, but I hope it makes no difference. Apologies if it
does.)

Reproduce code:
---------------
Make a directory called foo, under $HOME.
Put this file as test.php in $HOME:
<?
echo $_SERVER["SCRIPT_FILENAME"] . "\n";
Now cd to $HOME
Execute: php foo/test.php


Expected result:
----------------
<path to your home directory>/foo/test.php

Actual result:
--------------
foo/test.php


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26429&edit=1

Reply via email to