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

WBOY
Release: 2016-06-13 13:37:25
Original
872 people have browsed it

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;
}


Copy after login


结果是脚本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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!