我想为systemd创建一个单元文件,它将在服务器重新启动后自动启动PHP。
以下是文件内容:
[Unit]
Description=PHP 5.5.32 FPM
[Service]
User=deploy
Group=deploy
WorkingDirectory=/home/deploy
ExecStartPre=/usr/local/bin/phpbrew use 5.5.32
ExecStart=/usr/local/bin/phpbrew fpm start
[Install]
WantedBy=multi-user.target但是,当我试图通过运行sudo systemctl start php55-fpm.service启动服务时,不知怎么的,它不起作用。
这是sudo systemctl status php55-fpm.service的输出
● php55-fpm.service - PHP 5.5.32 FPM
Loaded: loaded (/usr/lib/systemd/system/php55-fpm.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2016-03-30 05:13:52 CDT; 3min 50s ago
Process: 20444 ExecStart=/usr/local/bin/phpbrew fpm start (code=exited, status=0/SUCCESS)
Process: 20441 ExecStartPre=/usr/local/bin/phpbrew use 5.5.32 (code=exited, status=0/SUCCESS)
Main PID: 20444 (code=exited, status=0/SUCCESS)
Mar 30 05:13:52 web1 phpbrew[20444]: sami - http://get.sensiolabs.org/sami.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phpcs - https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
Mar 30 05:13:52 web1 phpbrew[20444]: pdepend - http://static.pdepend.org/php/latest/pdepend.phar
Mar 30 05:13:52 web1 phpbrew[20444]: onion - https://raw.githubusercontent.com/phpbrew/Onion/master/onion
Mar 30 05:13:52 web1 phpbrew[20444]: box-2.5 - https://github.com/box-project/box2/releases/download/2.5.2/box-2.5.2.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phpcov - https://phar.phpunit.de/phpcov.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phpcpd - https://phar.phpunit.de/phpcpd.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phpdcd - https://phar.phpunit.de/phpdcd.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phptok - https://phar.phpunit.de/phptok.phar
Mar 30 05:13:52 web1 phpbrew[20444]: phploc - https://phar.phpunit.de/phploc.phar其他信息:
SELinux被禁用
[root@web1 deploy]# sestatus
SELinux status: disabled我错过了什么吗?
谢谢!
发布于 2016-06-12 13:48:04
Phpbree1.22.0现在支持fpm setup --systemctl命令来帮助您设置服务。
在构建--with-fpm-systemd时,一定要启用php。
https://serverfault.com/questions/766992
复制相似问题