编译安装好PHP之后
whereis PHP
#拷贝配置文件
cp /PHP-7.1.14/PHP.ini-production /usr/local/PHP/etc/PHP.ini
cd /usr/local/PHP/etc
cp PHP-fpm.conf.default PHP-fpm.conf
cd PHP-fpm.d
cp www.conf.default www.conf
#添加服务文件
vi /etc/systemd/system/PHP-fpm.service
内容如下
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=simple
PIDFile=/run/PHP-fpm.pid
ExecStart=/usr/local/PHP/sbin/PHP-fpm --nodaemonize --fpm-config /usr/local/PHP/etc/PHP-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID
[Install]
WantedBy=multi-user.target
#添加到开机启动
systemctl enable PHP-fpm.service
#启动服务
systemctl start PHP-fpm.service
#查看状态
systemctl status PHP-fpm.service
原文链接:https://www.f2er.com/centos/374408.html