Configure PHP-FPM as service in Linux

Source: Internet
Author: User
This article mainly introduces in Linux will php-fpm configuration into service, has a certain reference value, now share to everyone, have the need of friends can refer to

After you install PHP

1, set php-fpm.conf, will; pid = run/php-fpm.pid Front semicolon removed

2. Copy the init.d.php-fpm from the extracted php folder to/etc/init.d/php-fpm

CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

3. Copy the init.d.php-fpm from the extracted php folder to/etc/init.d/php-fpm

4. Modify the php-fpm file

Will

php_fpm_bin= @sbindir @/php-fpmphp_fpm_conf= @sysconfdir @/php-fpm.confphp_fpm_pid= @localstatedir @/run/php-fpm.pid

Change into

php_fpm_bin=/usr/local/php/sbin/php-fpmphp_fpm_conf=/usr/local/php/etc/php-fpm.confphp_fpm_pid=/usr/local/php/ Var/run/php-fpm.pid

5. Implementation

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

After that, you can use the command service PHP-FPM Stop command directly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.