#34334 [Opn->Fbk]: $_ENV malformed; $_ENV['_'] == /usr/sbin/httpd
| From: | sniper@php.net | Date: | Wed, 07 Sep 2005 06:48:04 +0000 |
| Subject: | #34334 [Opn->Fbk]: $_ENV malformed; $_ENV['_'] == /usr/sbin/httpd | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84598@lists.php.net to get a copy of this message | ||
ID: 34334
Updated by: sniper@php.net
Reported By: tbarstow at workflowbydesignc dot om
-Status: Open
+Status: Feedback
Bug Type: CGI related
Operating System: OS X "Tiger"
PHP Version: 5.0.4
Previous Comments:
------------------------------------------------------------------------
[2005-09-01 23:43:09] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-09-01 19:51:15] tbarstow at workflowbydesignc dot om
Description:
------------
I have a CLI PHP script that is run via cron. Most of the time (about
75%) it runs without issue. Sometimes, however, I get output similar
to the following in my log file:
[01-Sep-2005 13:30:40] PHP Notice: Undefined index: HOME in
/path/to/file.php on line xx
[01-Sep-2005 13:30:40] Array
(
[PATH] =>
/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices
[PWD] => /
[SHLVL] => 3
[_] => /usr/sbin/httpd
)
Note that PHP and only PHP writes into this log file.
Reproduce code:
---------------
$scriptdir = "$_ENV[HOME]/automation";
error_log(print_r($_ENV,true));
Expected result:
----------------
I expect to see the $_ENV array printed into the log file, with the
name of the currently running php script in $_ENV['_']. I also expect
to see no error from the line that references $_ENV['HOME'].
Here is a "normal" entry, generated by the exact same script:
[01-Sep-2005 13:46:01] Array
(
[SHELL] => /bin/sh
[USER] => wbd
[SCRIPT_PATH] => /Users/wbd/automation
[PATH] => /usr/bin:/bin
[PWD] => /Users/wbd
[SHLVL] => 1
[HOME] => /Users/wbd
[LOG_PATH] => /Users/wbd/automation/_logs
[LOGNAME] => wbd
[_] => /Users/wbd/automation/_shared/everyMinute.php
[__CF_USER_TEXT_ENCODING] => 0x1F5:0:0
)
Actual result:
--------------
See log entry above.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34334&edit=1