Professional Web Applications Themes

#39207 [NEW]: Some $_SERVER variables missing on executing php5-cgi from shell - PHP Bugs

From: konradg at irc dot pl Operating system: Linux 2.6.17.6-amd64, Debian 3.0 PHP version: 5.1.6 PHP Bug Type: CGI related Bug description: Some $_SERVER variables missing on executing php5-cgi from shell Description: ------------ Some $_SERVER variables in fastcgi version (php5-cgi) are missing _only_ when executing directly from shell command line. Variables are: _SERVER["PHP_SELF"] (set but no value) _SERVER["SCRIPT_NAME"] (not set) _SERVER["SCRIPT_FILENAME"] (not set) _SERVER["PATH_TRANSLATED"] (not set) _SERVER["DOENT_ROOT"] (not set) These variables _are_ set in CLI version of php5 and when executing php5-cgi by web server. Reproduce code: --------------- echo "<? phpinfo() ?>" > info.php php5-cgi info.php > info.txt Expected result: ...

  1. #1

    Default #39207 [NEW]: Some $_SERVER variables missing on executing php5-cgi from shell

    From: konradg at irc dot pl
    Operating system: Linux 2.6.17.6-amd64, Debian 3.0
    PHP version: 5.1.6
    PHP Bug Type: CGI related
    Bug description: Some $_SERVER variables missing on executing php5-cgi from shell

    Description:
    ------------
    Some $_SERVER variables in fastcgi version (php5-cgi) are missing _only_
    when executing directly from shell command line.

    Variables are:
    _SERVER["PHP_SELF"] (set but no value)
    _SERVER["SCRIPT_NAME"] (not set)
    _SERVER["SCRIPT_FILENAME"] (not set)
    _SERVER["PATH_TRANSLATED"] (not set)
    _SERVER["DOENT_ROOT"] (not set)

    These variables _are_ set in CLI version of php5 and when executing
    php5-cgi by web server.

    Reproduce code:
    ---------------
    echo "<? phpinfo() ?>" > info.php
    php5-cgi info.php > info.txt

    Expected result:
    ----------------
    _SERVER["PHP_SELF"] => info.php
    _SERVER["SCRIPT_NAME"] => info.php
    _SERVER["SCRIPT_FILENAME"] => info.php
    _SERVER["PATH_TRANSLATED"] => info.php
    _SERVER["DOENT_ROOT"] =>
    _SERVER["REQUEST_TIME"] => 1161331562
    _SERVER["argv"] => Array
    (
    [0] => info.php
    )

    _SERVER["argc"] => 1


    in output

    Actual result:
    --------------
    _SERVER["PHP_SELF"] => no value
    _SERVER["REQUEST_TIME"] => 1161331600
    _SERVER["argv"] => Array
    _SERVER["argc"] => 1




    --
    Edit bug report at [url]http://bugs.php.net/?id=39207&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39207&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39207&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39207&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39207&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=39207&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=39207&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39207&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=39207&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=39207&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=39207&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=39207&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=39207&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=39207&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39207&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=39207&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=39207&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39207&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=39207&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39207&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39207&r=mysqlcfg[/url]
    konradg at irc dot pl Guest

  2. #2

    Default #39207 [Opn]: Some $_SERVER variables are missing when executing php5-cgi from shell

    ID: 39207
    User updated by: konradg at irc dot pl
    -Summary: Some $_SERVER variables missing on executing php5-cgi
    from shell
    Reported By: konradg at irc dot pl
    Status: Open
    Bug Type: CGI related
    Operating System: Linux 2.6.17.6-amd64, Debian 3.0
    PHP Version: 5.1.6
    New Comment:

    Better reproduce code:

    <?

    $vars = array ('PHP_SELF', 'SCRIPT_NAME', 'SCRIPT_FILENAME',
    'PATH_TRANSLATED', 'DOENT_ROOT');

    foreach ($vars as $v) {
    echo '_SERVER["'.$v.'"] => '.(isset($_SERVER[$v]) ?
    $_SERVER[$v] : '(not set)');
    echo "\n";
    }

    ?>

    Expected result (from CLI version):
    ------------------------------------
    php5 test.php
    _SERVER["PHP_SELF"] => test.php
    _SERVER["SCRIPT_NAME"] => test.php
    _SERVER["SCRIPT_FILENAME"] => test.php
    _SERVER["PATH_TRANSLATED"] => test.php
    _SERVER["DOENT_ROOT"] =>

    Actual result (FASTCGI version):
    ---------------------------------
    php5-cgi test.php
    _SERVER["PHP_SELF"] =>
    _SERVER["SCRIPT_NAME"] => (not set)
    _SERVER["SCRIPT_FILENAME"] => (not set)
    _SERVER["PATH_TRANSLATED"] => (not set)
    _SERVER["DOENT_ROOT"] => (not set)

    Thanks.


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

    [2006-10-20 08:14:17] konradg at irc dot pl

    Description:
    ------------
    Some $_SERVER variables in fastcgi version (php5-cgi) are missing
    _only_ when executing directly from shell command line.

    Variables are:
    _SERVER["PHP_SELF"] (set but no value)
    _SERVER["SCRIPT_NAME"] (not set)
    _SERVER["SCRIPT_FILENAME"] (not set)
    _SERVER["PATH_TRANSLATED"] (not set)
    _SERVER["DOENT_ROOT"] (not set)

    These variables _are_ set in CLI version of php5 and when executing
    php5-cgi by web server.

    Reproduce code:
    ---------------
    echo "<? phpinfo() ?>" > info.php
    php5-cgi info.php > info.txt

    Expected result:
    ----------------
    _SERVER["PHP_SELF"] => info.php
    _SERVER["SCRIPT_NAME"] => info.php
    _SERVER["SCRIPT_FILENAME"] => info.php
    _SERVER["PATH_TRANSLATED"] => info.php
    _SERVER["DOENT_ROOT"] =>
    _SERVER["REQUEST_TIME"] => 1161331562
    _SERVER["argv"] => Array
    (
    [0] => info.php
    )

    _SERVER["argc"] => 1


    in output

    Actual result:
    --------------
    _SERVER["PHP_SELF"] => no value
    _SERVER["REQUEST_TIME"] => 1161331600
    _SERVER["argv"] => Array
    _SERVER["argc"] => 1





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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39207&edit=1[/url]
    konradg at irc dot pl Guest

  3. #3

    Default #39207 [Opn->Bgs]: Some $_SERVER variables are missing when executing php5-cgi from shell

    ID: 39207
    Updated by: [email]tony2001php.net[/email]
    Reported By: konradg at irc dot pl
    -Status: Open
    +Status: Bogus
    Bug Type: CGI related
    Operating System: Linux 2.6.17.6-amd64, Debian 3.0
    PHP Version: 5.1.6
    New Comment:

    Thank you for taking the time to write to us, but this is not
    a bug. Please double-check the doentation available at
    [url]http://www.php.net/manual/[/url] and the instructions on how to report
    a bug at [url]http://bugs.php.net/how-to-report.php[/url]

    Thos variables are populated by the web-server.


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

    [2006-10-20 09:22:41] konradg at irc dot pl

    Better reproduce code:

    <?

    $vars = array ('PHP_SELF', 'SCRIPT_NAME', 'SCRIPT_FILENAME',
    'PATH_TRANSLATED', 'DOENT_ROOT');

    foreach ($vars as $v) {
    echo '_SERVER["'.$v.'"] => '.(isset($_SERVER[$v]) ?
    $_SERVER[$v] : '(not set)');
    echo "\n";
    }

    ?>

    Expected result (from CLI version):
    ------------------------------------
    php5 test.php
    _SERVER["PHP_SELF"] => test.php
    _SERVER["SCRIPT_NAME"] => test.php
    _SERVER["SCRIPT_FILENAME"] => test.php
    _SERVER["PATH_TRANSLATED"] => test.php
    _SERVER["DOENT_ROOT"] =>

    Actual result (FASTCGI version):
    ---------------------------------
    php5-cgi test.php
    _SERVER["PHP_SELF"] =>
    _SERVER["SCRIPT_NAME"] => (not set)
    _SERVER["SCRIPT_FILENAME"] => (not set)
    _SERVER["PATH_TRANSLATED"] => (not set)
    _SERVER["DOENT_ROOT"] => (not set)

    Thanks.

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

    [2006-10-20 08:14:17] konradg at irc dot pl

    Description:
    ------------
    Some $_SERVER variables in fastcgi version (php5-cgi) are missing
    _only_ when executing directly from shell command line.

    Variables are:
    _SERVER["PHP_SELF"] (set but no value)
    _SERVER["SCRIPT_NAME"] (not set)
    _SERVER["SCRIPT_FILENAME"] (not set)
    _SERVER["PATH_TRANSLATED"] (not set)
    _SERVER["DOENT_ROOT"] (not set)

    These variables _are_ set in CLI version of php5 and when executing
    php5-cgi by web server.

    Reproduce code:
    ---------------
    echo "<? phpinfo() ?>" > info.php
    php5-cgi info.php > info.txt

    Expected result:
    ----------------
    _SERVER["PHP_SELF"] => info.php
    _SERVER["SCRIPT_NAME"] => info.php
    _SERVER["SCRIPT_FILENAME"] => info.php
    _SERVER["PATH_TRANSLATED"] => info.php
    _SERVER["DOENT_ROOT"] =>
    _SERVER["REQUEST_TIME"] => 1161331562
    _SERVER["argv"] => Array
    (
    [0] => info.php
    )

    _SERVER["argc"] => 1


    in output

    Actual result:
    --------------
    _SERVER["PHP_SELF"] => no value
    _SERVER["REQUEST_TIME"] => 1161331600
    _SERVER["argv"] => Array
    _SERVER["argc"] => 1





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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=39207&edit=1[/url]
    tony2001@php.net Guest

Similar Threads

  1. PHP 4.3.8: $_SERVER[argv] missing
    By steve in forum PHP Development
    Replies: 2
    Last Post: September 29th, 08:34 PM
  2. [PHP] executing shell commands.
    By Samir Sethi in forum PHP Development
    Replies: 7
    Last Post: September 11th, 07:37 AM
  3. executing a shell command within a function
    By Svlyp in forum PHP Development
    Replies: 0
    Last Post: August 16th, 12:19 AM
  4. #24584 [Opn->Bgs]: missing one _SERVER var
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: July 10th, 04:59 PM
  5. #24584 [NEW]: missing one _SERVER var
    By bretschneider at element5 dot com in forum PHP Development
    Replies: 0
    Last Post: July 10th, 10:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139