Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中运行的python脚本没有输出_Php_Python_Curl_Nginx - Fatal编程技术网

在php中运行的python脚本没有输出

在php中运行的python脚本没有输出,php,python,curl,nginx,Php,Python,Curl,Nginx,在运行“php file.php”的终端中,以下脚本按预期输出文本 <?php $command = escapeshellcmd("python /root/installer.py"); $output = shell_exec($command); echo $output; ?> # php /usr/share/zabbix/rackspace/index.php test 但是如果我卷曲这个页面,就不会有输出,也不会有错误 [root@http-1 ~]# curl

在运行“php file.php”的终端中,以下脚本按预期输出文本

<?php
$command = escapeshellcmd("python /root/installer.py");
$output = shell_exec($command);
echo $output;
?>

# php /usr/share/zabbix/rackspace/index.php
test
但是如果我卷曲这个页面,就不会有输出,也不会有错误

[root@http-1 ~]# curl fake.url.com 

[root@http-1 ~]#
我的nginx在此页面的配置如下:

server {
        listen       [::]:80;
        listen       80;
        server_name  fake.url.com;
        access_log  /var/log/nginx/installer.log main;
        root   /usr/share/zabbix/url/;
        index index.php index.htm index.html;
        error_page  404              /404.html;
location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                  }
       }
有人能帮我做点什么吗


谢谢

确保nginx的用户具有对“/root/installer.py”的执行访问权限。我已经做了/root/installer.py 777,但仍然没有任何错误。检查nginx日志是否有任何错误。
server {
        listen       [::]:80;
        listen       80;
        server_name  fake.url.com;
        access_log  /var/log/nginx/installer.log main;
        root   /usr/share/zabbix/url/;
        index index.php index.htm index.html;
        error_page  404              /404.html;
location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                  }
       }