簡體   English   中英

服務 php-fpm 不支持 chkconfig

[英]Service php-fpm does not support 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

/etc/init.d 中是否有 php-fpm 腳本? 這就是 chkconfig 的工作原理。 它在腳本中查找注釋:

 # chkconfig: 345 26 74

找出應該配置哪些運行級別。 如果沒有 php-fpm init 腳本,或者該腳本不包含該 chkconfig 注釋,則 chkconfig 沒有任何工作。

在 PHP 5.3.x 中,源發行版中已經有一個文件php-5.3.3/sapi/fpm/init.d.php-fpm ,必須將其移動到/etc/rc.d/init.d文件夾中。 通過 chmod +x 使其可執行,您就完成了,現在可以對其進行 chkconfig。

  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

該腳本必須有 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>.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM