"PHP" PHP-FPM Configuration Insights

Source: Internet
Author: User
Tags fpm

Source: PHP Official documentation

Init Script Setup
===

You'll probably want to create a init script for your new php-fpm. Fortunately, PHP 5.3.3 provides one for your, which you should copy to your init directory and Change permissions:

$ CP <PHP-5.3.3-SOURCE-DIR>/SAPI/FPM/INIT.D.PHP-FPM.IN/ETC/INIT.D/PHP-FPM
$ chmod 755/ETC/INIT.D/PHP-FPM

It requires a certain amount of setup. First of all, make sure your php-fpm.conf file are set up to create a PID file when PHP-FPM starts. e.g.:
----
PID =/var/run/php-fpm.pid
----
(also make sure your PHP-FPM user have permission to create the this file).

Now open up your new init script (/ETC/INIT.D/PHP-FPM) and set the variables on the top to their relevant values. e.g.:
---
prefix=
exec_prefix=
php_fpm_bin=/sbin/php-fpm
Php_fpm_conf=/etc/php-fpm.conf
Php_fpm_pid=/var/run/php-fpm.pid
---

Your init script is now ready. You should now is able to start, stop and reload PHP-FPM:

$/etc/init.d/php-fpm Start
$/etc/init.d/php-fpm Stop
$/etc/init.d/php-fpm Reload

The one remaining thing the wish to does is to add your new PHP-FPM init script to system start-up. e.g. in CentOS:

$/sbin/chkconfig PHP-FPM on

===========

Disclaimer:although I did just does this in my own server about mins ago, everything I ' ve written here is off the top of My head, so it could be 100% correct. Also, allow for differences in system setup. Some Understanding's doing is assumed.

"PHP" PHP-FPM Configuration Insights

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.