Php nginx-未指定输入文件。无法打开主脚本
从昨天开始,我一直在与nginx和laravel进行斗争,试图让应用程序在服务器上运行,但没有成功。 这是我使用的nginx配置。如果有任何错误,请帮助我Php nginx-未指定输入文件。无法打开主脚本,php,laravel,nginx,Php,Laravel,Nginx,从昨天开始,我一直在与nginx和laravel进行斗争,试图让应用程序在服务器上运行,但没有成功。 这是我使用的nginx配置。如果有任何错误,请帮助我 server { server_name myanime.com.tn www.myanime.com.tn; listen 80; set $CPANEL_APACHE_PROXY_IP 1.1.1.1;#i just change the ip for security reason listen 443
server {
server_name myanime.com.tn www.myanime.com.tn;
listen 80;
set $CPANEL_APACHE_PROXY_IP 1.1.1.1;#i just change the ip for security reason
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256;
access_log /home/myanimecom/logs/myanime.com.access.log;
error_log /home/myanimecom/logs/myanime.com.error.log;
root /home/myanimecom/public_html/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
include conf.d/server-includes/*.conf;
include conf.d/users/myanimecom/*.conf;
include conf.d/users/myanimecom/myanime.com.tn/*.conf;
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/bfc378ea0889abf1d595c5a9a7eda010181dee91.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
include conf.d/includes-optional/cpanel-cgi-location.conf;
include conf.d/includes-optional/cpanel-server-parsed-location.conf;
}
# nginx does not support a subdomain of a wildcard domain
# Example: whm.*.mydomain.tld would not be allowed
#### SSL Proxies for myanime.com.tn ##
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name cpanel.myanime.com.tn;
location / {
# since proxy_set_header can not be done inside an if block we jump though hoops
# default value is empty because the header will be only sent if $value is not empty
set $upgrade_value "";
set $connection_value "";
if ($http_upgrade ~* ^websocket$) {
set $upgrade_value $http_upgrade;
set $connection_value "upgrade";
}
# In nginx you still need to use `http` for protocol in your url and not `ws`.
# The `ws` and `wss` protocol are required for browser, in the nginx side we add
# the headers below to handle the websockets over `http`.
proxy_set_header Upgrade $upgrade_value; # the header will be only sent if $upgrade_value is not empty
proxy_set_header Connection $connection_value; # the header will be only sent if $connection_value is not empty
proxy_http_version 1.1;
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2082;
}
}
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name cpcalendars.myanime.com.tn;
location / {
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2079;
}
}
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name cpcontacts.myanime.com.tn;
location / {
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2079;
}
}
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name webdisk.myanime.com.tn;
location / {
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2077;
}
}
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name webmail.myanime.com.tn;
location / {
# since proxy_set_header can not be done inside an if block we jump though hoops
# default value is empty because the header will be only sent if $value is not empty
set $upgrade_value "";
set $connection_value "";
if ($http_upgrade ~* ^websocket$) {
set $upgrade_value $http_upgrade;
set $connection_value "upgrade";
}
# In nginx you still need to use `http` for protocol in your url and not `ws`.
# The `ws` and `wss` protocol are required for browser, in the nginx side we add
# the headers below to handle the websockets over `http`.
proxy_set_header Upgrade $upgrade_value; # the header will be only sent if $upgrade_value is not empty
proxy_set_header Connection $connection_value; # the header will be only sent if $connection_value is not empty
proxy_http_version 1.1;
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2095;
}
}
server {
listen 443 ssl;
ssl_certificate /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
ssl_certificate_key /var/cpanel/ssl/apache_tls/myanime.com.tn/combined;
server_name whm.myanime.com.tn;
location / {
# since proxy_set_header can not be done inside an if block we jump though hoops
# default value is empty because the header will be only sent if $value is not empty
set $upgrade_value "";
set $connection_value "";
if ($http_upgrade ~* ^websocket$) {
set $upgrade_value $http_upgrade;
set $connection_value "upgrade";
}
# In nginx you still need to use `http` for protocol in your url and not `ws`.
# The `ws` and `wss` protocol are required for browser, in the nginx side we add
# the headers below to handle the websockets over `http`.
proxy_set_header Upgrade $upgrade_value; # the header will be only sent if $upgrade_value is not empty
proxy_set_header Connection $connection_value; # the header will be only sent if $connection_value is not empty
proxy_http_version 1.1;
include conf.d/includes-optional/cpanel-proxy.conf;
proxy_pass http://127.0.0.1:2086;
}
}
这是cpanel php fpm服务的状态
● cpanel_php_fpm.service - FPM service for cPanel Daemons
Loaded: loaded (/etc/systemd/system/cpanel_php_fpm.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2020-09-14 13:57:43 GMT; 53min ago
Process: 1985 ExecStart=/usr/local/cpanel/scripts/restartsrv_cpanel_php_fpm --notconfigured-ok --systemd-service=cpanel_php_fpm (code=exited, status=0/SUCCESS)
Main PID: 2256 (cpanel_php_fpm)
CGroup: /system.slice/cpanel_php_fpm.service
└─2256 php-fpm: master process (/usr/local/cpanel/etc/php-fpm.conf)
Sep 14 13:57:43 NC-PH-2643.web-hosting.com systemd[1]: Starting FPM service for cPanel Daemons...
Sep 14 13:57:43 NC-PH-2643.web-hosting.com systemd[1]: Started FPM service for cPanel Daemons.
这是给nginx的
Redirecting to /bin/systemctl status nginx.service
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2020-09-14 14:42:57 GMT; 9min ago
Docs: http://nginx.org/en/docs/
Process: 6100 ExecStopPost=/bin/sh -c ps -C nginx -o pid,command= --no-headers | grep "nginx: logger process" | awk "{ print \$1 }" | xargs -r kill -9; ps -C splitlogs -o pid,command= --no-headers | grep "nginx/domains" | awk "{ print \$1 }" | xargs -r kill -9 (code=exited, status=0/SUCCESS)
Process: 6095 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 6110 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 6126 (nginx)
CGroup: /system.slice/nginx.service
├─6111 Passenger watchdog
├─6114 Passenger core
├─6124 nginx: logger process
├─6125 /usr/local/cpanel/bin/splitlogs --dir=/var/log/nginx/domains --main=nc-ph-2643....
├─6126 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
├─6127 /usr/local/cpanel/bin/splitlogs --dir=/var/log/nginx/domains --main=nc-ph-2643....
└─6132 nginx: worker process
Sep 14 14:42:57 NC-PH-2643.web-hosting.com systemd[1]: Starting nginx - high performance web se.....
Sep 14 14:42:57 NC-PH-2643.web-hosting.com systemd[1]: Started nginx - high performance web server.
Hint: Some lines were ellipsized, use -l to show in full.
除此之外,我在日志文件中得到了这个错误
FastCGI sent in stderr: "Unable to open primary script: /home/myanimecom/public_html/public/index.php (No such file or directory)" while reading response header from upstream, client: 197.1.242.200, server: myanime.com.tn, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/opt/cpanel/ea-php70/root/usr/var/run/php-fpm/bfc378ea0889abf1d595c5a9a7eda010181dee91.sock:", host: "myanime.com.tn"
谢谢你的帮助