php-fpm 开机自启
-
cp /php5.6/sapi/fpm/php-fpm.service /etc/systemd/system/php-fpm.service
systemctl status php-fpm 会报错
Warning: The unit file, source configuration file or drop-ins of php-fpm.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: bad-setting (Reason: Unit php-fpm.service has a bad unit file setting.)
Active: inactive (dead)
Apr 01 04:33:42 c9fae32d6e28 systemd[1]: /etc/systemd/system/php-fpm.service:7: PIDFile= path is not absolute, ignoring: ${prefix}/var/run/php-fpm.pid
Apr 01 04:33:42 c9fae32d6e28 systemd[1]: /etc/systemd/system/php-fpm.service:8: Neither a valid executable name nor an absolute path: ${exec_prefix}/sbin/php-fpm
Apr 01 04:33:57 c9fae32d6e28 systemd[1]: /etc/systemd/system/php-fpm.service:7: PIDFile= path is not absolute, ignoring: ${prefix}/var/run/php-fpm.pid
Apr 01 04:33:57 c9fae32d6e28 systemd[1]: /etc/systemd/system/php-fpm.service:8: Neither a valid executable name nor an absolute path: ${exec_prefix}/sbin/php-fpm
[root@c9fae32d6e28 /]# vim /etc/systemd/system/php-fpm.service %
原因是服务配置文件 需要绝对路径

浙公网安备 33010602011771号