ID: 34334 User updated by: tbarstow at workflowbydesignc dot om Reported By: tbarstow at workflowbydesignc dot om -Status: Feedback +Status: Open Bug Type: CGI related Operating System: OS X "Tiger" PHP Version: 5.0.4 New Comment:
Just changing my email address; I mistyped it and never got notified that there was feedback on this. Will test now. Previous Comments: ------------------------------------------------------------------------ [2005-09-01 23:43:09] [EMAIL PROTECTED] 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