CentOS7 php-cgi系统开机自启脚本设置


cat >/usr/lib/systemd/system/php-cgi.service<<EOF
[Unit]
Description=php-cgi
#After=network.target
#Before=network.target

[Service]
Type=forking
ExecStart=/usr/local/php5/sbin/php-fpm -c /usr/local/php5/etc/php5.ini

[Install]
WantedBy=multi-user.target
Alias=php-cgi.service
EOF

systemctl enable php-cgi