Phing exec command to set environment variable
问题 I'm trying to set an environment variable in a build script with phing. This is normally done command line like this: export MY_VAR=value In Phing I did the following but it isn't working. <exec command="export MY_VAR=value" /> 回答1: Bold claim: There is no way to set/export a (Unix) shell variable in PHP so that it is visible inside the scope that started the php script. php myfile.php (does putenv or shell_exec('export foo=bar');) echo $foo Will return nothing. As PHP can not do it so