php-fpm 7.2 配置开机自启动
转载声明:
本文为摘录自“csdn博客”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2023-03-24 23:21:31
php-fpm 7.2 配置开机自启动
1、准备文件
- /usr/lib/systemd/system/php-fpm.service
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
#后台运行
Type=forking
# pid文件 在php-fpm.conf文件里定义
PIDFile=/application/system/php7/var/run/php-fpm.pid
# php-fpm二进制文件所在位置
ExecStart=/application/system/php7/sbin/php-fpm
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
2、加载并启动
systemctl daemon-reload
systemctl start php-fpm
3、报错解决
问题1:
php-fpm: error while loading shared libraries: libexslt.so.0: cannot open shared object file.
解决:
yum install php-xml -y
问题2:
php-fpm: error while loading shared libraries: libjpeg.so.62: cannot open shared object file.
解决:
yum install libjpeg
问题3:
ERROR: [pool www] cannot get uid for user 'deployer'
ERROR: FPM initialization failed
解决:
useradd deployer
4、启动后验证,并设置开机自启动
systemctl status php-fpm
systemctl enable php-fpm
ps -ef|grep php-fpm