该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
树莓派raspbian系统用nginx和php7.3-fpm搭建一个简单的web服务器,软件安装完成并启动成功,也能正常访问。
修改/etc/nginx/sites-enabled/default文件配置php后。systemctl restart nginx就无法启动了。
default文件修改两处内容如下:
第一处
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
第二处:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
systemctl restart nginx后的错误信息:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
root@raspberrypi:/etc/nginx/sites-enabled# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-11-08 16:32:58 CST; 17s ago
Docs: man:nginx(8)
Process: 618 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILU
Nov 08 16:32:57 raspberrypi systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 08 16:32:58 raspberrypi nginx[618]: nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/site
Nov 08 16:32:58 raspberrypi nginx[618]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 08 16:32:58 raspberrypi systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 08 16:32:58 raspberrypi systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 08 16:32:58 raspberrypi systemd[1]: Failed to start A high performance web server and a reverse proxy serve
说是代码错误,但是哪错了啊!?大家都是这么写的。请各位大神帮了看看。谢谢了!