centos配置PHP遇到的问题之一
查看失败原因
执行命令
systemctl status php-fpm.service
journalctl -xe
tail -20 /var/log/messages
找到有ERROR描述的内容,是出现错误的关键信息,如下:
根据提示信息‘cannot get uid for user ‘nginx’ ’,说明php配置文件中使用了不存在的系统用户nginx。
为系统创建用户nginx,用户组nginx
useradd -r nginx
groupadd nginx
再次启动服务
sudo systemctl start php-fpm
启动服务成功