note 32692 deleted from function.shell-exec by cmb
| From: | cmb@php.net | Date: | Sun, 14 Jul 2019 11:38:11 +0000 |
| Subject: | note 32692 deleted from function.shell-exec by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211597@lists.php.net to get a copy of this message | ||
Note Submitter: Ben
----
When running subprocesses via shell_exec (and maybe others) from Apache/mod_php4, Apache's
environment variables don't seem to be passed on to the subprocess environment unless you
specifically force them by using putenv something like this:
$remaddr = getenv("REMOTE_ADDR");
putenv("REMOTE_ADDR=$remaddr");
shell_exec("/path/to/subprocess");