start php-fpm

From WebHostingNeeds.com
Jump to: navigation, search

Method 1

service php-fpm start
[[email protected] ~]# service php-fpm start
Starting php-fpm  done
[[email protected] ~]#

Method 2

/usr/local/php-fpm/sbin/php-fpm  -c /usr/local/php-fpm/etc/php-fpm.conf -F

Default it will run on port 9000

[[email protected] run]# /usr/local/php-fpm/sbin/php-fpm  -c /usr/local/php-fpm/etc/php-fpm.conf -F
[29-Jan-2014 15:42:28] NOTICE: fpm is running, pid 20108
[29-Jan-2014 15:42:28] NOTICE: ready to handle connections
^C[29-Jan-2014 15:46:30] NOTICE: Terminating ...
[29-Jan-2014 15:46:30] NOTICE: exiting, bye-bye!
[[email protected] run]#

-D instead of -F to run as deamon.

php-fpm Help

[[email protected] php-5.5.8]# /usr/local/php-fpm/sbin/php-fpm -h
Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F]
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -h               This help
  -i               PHP information
  -m               Show compiled in modules
  -v               Version number
  -p, --prefix <dir>
                   Specify alternative prefix path to FastCGI process manager (default: /usr/local/php-fpm).
  -g, --pid <file>
                   Specify the PID file location.
  -y, --fpm-config <file>
                   Specify alternative path to FastCGI process manager config file.
  -t, --test       Test FPM configuration and exit
  -D, --daemonize  force to run in background, and ignore daemonize option from config file
  -F, --nodaemonize
                   force to stay in foreground, and ignore daemonize option from config file
  -R, --allow-to-run-as-root
                   Allow pool to run as root (disabled by default)
[[email protected] php-5.5.8]#


Running PHP-FPM as Deamon

[[email protected] ~]# /usr/local/php-fpm/sbin/php-fpm -D
[[email protected] ~]# ps aux | grep php-fpm
root     20124  0.0  0.9 204372  4556 ?        Ss   15:58   0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)
nobody   20125  0.0  0.8 204372  3980 ?        S    15:58   0:00 php-fpm: pool www
nobody   20126  0.0  0.8 204372  3980 ?        S    15:58   0:00 php-fpm: pool www
root     20128  0.0  0.1 103236   848 pts/0    S+   15:58   0:00 grep php-fpm
[[email protected] ~]#




install php-fpm from source on centos