2016-03-16 1 views
2

PHP 7 построен из источниковPHP-FPM как сервис на Centos 7

При попытке

systemctl enable php-fpm.service 

получить

The unit files have no [Install] section. They are not meant to be enabled 
using systemctl. 
Possible reasons for having this kind of units are: 
1) A unit may be statically enabled by being symlinked from another unit's 
    .wants/ or .requires/ directory. 
2) A unit's purpose may be to act as a helper for some other unit which has 
    a requirement dependency on it. 
3) A unit may be started when needed via activation (socket, path, timer, 
    D-Bus, udev, scripted systemctl call, ...). 

При попытке

chkconfig --levels 235 php-fpm on 

получить тот же журнал :)

Обновление:

Как-то мне удалось начать с chkconfig, но я не помню как. После переустановки ОС и использования PHP 7.0.6-dev.

+0

Любые обновления по вашему вопросу? Еще нужна помощь? –

ответ

2

Поскольку вы компилируете свой собственный PHP потребность блок/услуг будет создан, вы можете сделать это с помощью chkconfig, как вы делали, или вы можете попытаться следовать некоторым рекомендациям, которые я бы рекомендовал:

https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html

Пример файла с первого урока:

[Unit] 
Description=The PHP 7 FastCGI Process Manager 
After=network.target 

[Service] 
Type=simple 
PIDFile=/opt/php-7.0.3/var/run/php-fpm.pid 
ExecStart=/opt/php-7.0.3/sbin/php-fpm --nodaemonize --fpm-config /opt/php-7.0.3/etc/php-fpm.conf 
ExecReload=/bin/kill -USR2 $MAINPID 

[Install] 
WantedBy=multi-user.target 

я увидел обновленный вы уже решить d вопрос, но я оставлю его здесь, так как он может помочь большему количеству людей!

 Смежные вопросы

  • Нет связанных вопросов^_^