Req #37989 [Com]: Enviroment variables not availabe on exec,mail,...

From: Date: Tue, 05 Sep 2023 10:13:50 +0000
Subject: Req #37989 [Com]: Enviroment variables not availabe on exec,mail,...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245335@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=37989&edit=1 ID: 37989 Comment by: arturostreicha at gmail dot com Reported by: david at ols dot es Summary: Enviroment variables not availabe on exec,mail,... Status: Open Type: Feature/Change Request Package: *General Issues Operating System: Linux PHP Version: 4.4.2 Block user comment: N Private report: N New Comment: Here information is given by you is too great it is very help for me thank you for this. (https://github.com.php)(https://tellpizzahut.pro/) Previous Comments: ------------------------------------------------------------------------ [2021-09-09 12:38:38] cmb@php.net Related To: Bug #36341 ------------------------------------------------------------------------ [2019-06-19 05:54:10] erik at coretech dot se You should be able to achieve this via proc_open(): Argument env: An array with the environment variables for the command that will be run, or NULL to use the same environment as the current PHP process I don't think it would be a great idea to enable this for exec() per default as it would change behaviour for existing scripts and possibly copying terminal variables and such which could break the scripts or introduce unwanted effects. /Erik Lundin ------------------------------------------------------------------------ [2017-01-21 07:53:29] david at ols dot es yes, as an exmaple, having the REMOTE_ADDR user ip address will be very helpful when calling mail so the mailer could check it against spamhaus/cbl , also having REQUEST_URI available could help tracking problems in an enviroment where one has control over the mailer but not over the customer php scripts, specially when the website has been compromised or infected by malware. Will be really useful to track and limit the damage caused in such situations. ------------------------------------------------------------------------ [2017-01-20 21:06:45] heiglandreas@php.net Is this still relevant? ------------------------------------------------------------------------ [2015-12-08 12:49:03] david at ols dot es Related To: Bug #36341 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=37989 -- Edit this bug report at https://bugs.php.net/bug.php?id=37989&edit=1

« previous php.bugs (#245335) next »