How to set command line enviroment variable in PHP shell_exec

chains

New Member
The script I am trying to run via shell_exec in PHP requires an environmental variable to be set, which afaik is done via:\[code\]export VARIABLE=value\[/code\]However, to run the script I am forced to do:\[code\]<?PHP$sOutput = shell_exec("export VARIABLE=value && my_command_goeth_hereth");\[/code\]It seams kinda pointless to have to export the variable every time I run any commands. Is this the only way to do it, or am I missing a much simpler way?
 
Back
Top