我是 CentOS 的新手,我用 Virtualmin 安装了 LEMP 堆栈,我有一个有线问题,当我执行一些使用我手动添加的模块的 PHP 代码时,如 Chilkat 或 ionecube 加载器,PHP 会在浏览器上显示一个空屏幕的内部服务器错误 500 ,但是当我使用 SSH 命令运行此文件时
php play.php
它正确执行并在屏幕上显示结果,所以不确定 NGINX 和 PHP-CGI 可能是什么问题?在我手动安装了 LEMP 堆栈后,我安装了 Virtualmin,并且有我的 NGINX Conf 文件
server_names_hash_bucket_size 128;
server {
server_name mydomain.com www.mydomain.com;
listen ip;
root /home/mydomain/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/mydomain.com_access_log;
error_log /var/log/virtualmin/mydomain.com_error_log;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /home/mydomain/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/mydomain/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/159588147640444.sock/socket;
}
listen ip:443 default ssl;
ssl_certificate /home/mydomain/ssl.cert;
ssl_certificate_key /home/mydomain/ssl.key;
fastcgi_read_timeout 60;
}
提前致谢。