Home >Backend Development >PHP Tutorial > php脚本无法获取指定的环境变量,该如何解决

php脚本无法获取指定的环境变量,该如何解决

WBOY
WBOYOriginal
2016-06-13 13:37:25900browse

php脚本无法获取指定的环境变量
写了个php脚本:

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
function updateReq(){
    exec("python /home/gun/app/clim.py ",$outPut);
    return $outPut;
}




结果是脚本clim.py 无法获取指定的环境变量
环境变量设置好了,root账户直接运行clim.py没问题,难道是权限问题?

------解决方案--------------------
PHP code

$out = array();
exec = ('ls', $out);
print_r($out);
//可以不可以
<br><font color="#e78608">------解决方案--------------------</font><br>
这个跟你的环境变量有关吧。。 <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn