Home  >  Article  >  Backend Development  >  Configure php-fpm as service in linux

Configure php-fpm as service in linux

不言
不言Original
2018-04-28 14:14:332589browse

This article mainly introduces configuring php-fpm as service in Linux. It has certain reference value. Now I share it with you. Friends in need can refer to it

After installing php

1. Set up php-fpm.conf and remove the semicolon in front of ;pid = run/php-fpm.pid

2. Remove the init.d in the decompressed php folder. Copy php-fpm to /etc/init.d/php-fpm

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

3. Copy init.d.php-fpm in the decompressed php folder to /etc /init.d/php-fpm

4. Modify the php-fpm file

Change

php_fpm_BIN=@sbindir@/php-fpm
php_fpm_CONF=@sysconfdir@/php-fpm.conf
php_fpm_PID=@localstatedir@/run/php-fpm.pid

to

php_fpm_BIN=/usr/local/php/sbin/php-fpm
php_fpm_CONF=/usr/local/php/etc/php-fpm.conf
php_fpm_PID=/usr/local/php/var/run/php-fpm.pid

5. After executing

chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on

, you can directly use the command service php-fpm stop and other commands


The above is the detailed content of Configure php-fpm as service in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn