Fastcgi-php-starter-for-freebsd » History » Revision 3

« Previous | Revision 3/14 (diff) | Next »
davojan, 2006-05-15 12:48
almost ready

= Handy External Spawning FastCGI PHP Processes in FreeBSD =
The script attached should be very handy for FreeBSD users. This is rc.d script to spawn FastCGI PHP processes. It is based on [source:tags/lighttpd-1.4.8/doc/] from doc/ directory in the lighttpd sources.

Just copy [] to /usr/local/etc/rc.d/. Then {{{ # cd /usr/local/etc/rc.d/ # chown root:wheel # chmod 544 # mkdir /var/run/fcgiphp # chown www:www /var/run/fcgiphp
You should replace www:www in the last line with your user:group which FastCGI will run under (see fcgiphp_user and fcgiphp_group in configuration below). Configuring
Here are configuration parameters with their default values, which you can change in /etc/rc.conf: {{{
fcgiphp_enable="NO" # enable FastCGI+PHP
fcgiphp_bin_path="/usr/local/bin/php" # absolute path to the PHP binary
fcgiphp_user="www" # switch to user
fcgiphp_group="www" # switch to group
fcgiphp_children="10" # number of PHP childs to spawn
fcgiphp_port="8002" # bind to tcp-port on localhost
fcgiphp_socket="/tmp/php-fastcgi.sock" # bind to unix domain socket
fcgiphp_env="SHELL PATH USER" # allowed environment variables sperated by spaces
fcgiphp_max_requests="500" # number of request server by a single php-process until is will be restarted
fcgiphp_addr="localhost" # adresses where PHP should access server connections from
To make script workable you must adjust only one thing: {{{
}}} Control
Now you can: {{{ # /usr/local/etc/rc.d/ start
Starting fcgiphp. # /usr/local/etc/rc.d/ stop
Stopping fcgiphp. # /usr/local/etc/rc.d/ restart
Stopping fcgiphp.
Starting fcgiphp.
}}} PHP + APC Issues
Coming soon...

Updated by davojan over 14 years ago · 3 revisions