Сервис php-fpm не поддерживает chkconfig

Все работает нормально.

Просто когда я chkconfig –add php-fpm

Выдает ошибку. Служба php-fpm не поддерживает chkconfig.

php-5.2.13 php-5.2.13-fpm-0.5.13.diff.gz

Ниже приведена конфигурация, которую я использую ./configure --enable-fastcgi --enable-fpm --build = x86_64-redhat-linux-gnu --host = x86_64-redhat-linux-gnu --target = x86_64-redhat-linux -gnu --program-prefix = --prefix = / usr --exec-prefix = / usr --bindir = / usr / bin --sbindir = / usr / sbin --sysconfdir = / etc --datadir = / usr / share --includedir = / usr / include --libdir = / usr / lib64 --libexecdir = / usr / libexec --localstatedir = / var --sharedstatedir = / usr / com --mandir = / usr / share / man --infodir = / usr / share / info --cache-file = .. / config.cache --with-libdir = lib64 --with-config-file-path = / etc --with-config-file-scan -dir = / etc / php.d --disable-debug --with-pic --disable-rpath --with-pear --with-bz2 --with-curl --with-exec-dir = / usr / bin --with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir = / usr --with-openssl --with-png --with-expat-dir = / usr --with-pcre-regex = / usr --with-zlib --with-layout = GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets - enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp- hack --with-unixODBC = shared, / usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic = / usr / share /file/magic.mime --without-sqlite --with-libxml-dir = / usr --with-xml --with-system-tzdata --without-mysql --without-gd --without-odbc - disable-dom --disable-dba --without-unixODBC --disable-pdo --disable-xmlreader --disable-xmlwriter


person ychian    schedule 20.05.2010    source источник


Ответы (4)


Есть ли в /etc/init.d скрипт php-fpm? Это то, над чем работает chkconfig. Ищет комментарий в скрипте:

 # chkconfig: 345 26 74

чтобы выяснить, какие уровни выполнения следует настроить. Если нет сценария инициализации php-fpm или сценарий не содержит этого комментария chkconfig, тогда chkconfig не над чем работать.

person Marc B    schedule 20.05.2010

В PHP 5.3.x уже есть файл php-5.3.3/sapi/fpm/init.d.php-fpm в исходном дистрибутиве, который просто нужно переместить в папку /etc/rc.d/init.d. Сделайте его исполняемым с помощью chmod + x, и все готово, и теперь можно выполнить chkconfig.

person Vladislav Rastrusny    schedule 18.11.2010

  1. vi /etc/init.d/php-fpm

    добавьте эти строки сверху (при необходимости измените пути):

    # chkconfig: - 85 15
    # processname: php-cgi
    # config:      /usr/local/php-fpm/etc/php-fpm.conf
    # config:      /etc/sysconfig/php-fpm
    # pidfile:     /usr/local/php-fpm/logs/php-fpm.pid
    
  2. vi /etc/sysconfig/php-fpm

    вставить:

    PHP-FPM_CONF_FILE=/usr/local/php-fpm/etc/php-fpm.conf
    
person Pawel    schedule 05.09.2010

В скрипте должно быть 2 строки:

# chkconfig: <levels> <start> <stop>

Например:

# chkconfig: 345 99 01

345 - levels to configure
99 - startup order
01 - stop order
After you add the above headers you can run chkconfig --add <service>.
person donaldgavis    schedule 26.03.2021