Configure php-fpm as service in linux

不言
Release: 2023-03-25 06:58:01
Original
2643 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

5. After executing

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

, 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template