Running and controlling

Once you have made the appropriate changes to the PHP-FPM configuration file, you may start it with the following command (the file paths may vary depending on your build configuration):

[user@local ~]# /usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini --pid /var/run/php-fpm.pid --fpm-config=/usr/local/php/etc/php-fpm.conf -D

The preceding command includes several important arguments:

  • -c /usr/local/php/etc/php.ini sets the path of the PHP configuration file
  • --pid /var/run/php-fpm.pid sets the path of the PID file, which can be useful to control the process via an init script
  • --fpm-config=/usr/local/php/etc/php-fpm.conf forces PHP-FPM to use the specified configuration file
  • -D daemonize PHP-FPM (ensures it runs in the background)

Other command-line arguments can be obtained by running php-fpm -h.

Stopping PHP-FPM can be done via the kill or killall commands. Alternatively, you may use an init script to start and stop the process, provided the version of PHP you installed came with one.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.118.160