php nginx exec失败,小白问题:用nginx配置php后nginx无法启动。

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

树莓派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

说是代码错误,但是哪错了啊!?大家都是这么写的。请各位大神帮了看看。谢谢了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值