Date: Thu, 6 Sep 2007 16:58:04 -0700 (PDT) From: Peter Pluta <peter@placidpublishing.net> To: freebsd-questions@freebsd.org Subject: Re: Nginx + FastCGI + PHP5 on FreeBSD 6.2 Message-ID: <12533660.post@talk.nabble.com> In-Reply-To: <fbpqui$vsh$1@sea.gmane.org> References: <12513880.post@talk.nabble.com> <fbpqui$vsh$1@sea.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Volodymyr Kostyrko-2 wrote: > > Peter Pluta wrote: > > nginx.conf snippet: > > server { > listen *:80; > server_name ...; > root ...; > access_log /var/log/nginx/....access.log; > index index.php; > > location ~ .*\.php$ { > include /usr/local/etc/nginx/fastcgi_params; > fastcgi_pass unix:/tmp/.fastcgi.www/socket; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME ...$fastcgi_script_name; > } > } > > /usr/local/etc/rc.d/phpFcgid script: > > #!/bin/sh > > # PROVIDE: phpFcgid > # REQUIRE: LOGIN > # KEYWORD: shutdown > > . /etc/rc.subr > > name="phpFcgid" > rcvar=`set_rcvar` > > load_rc_config $name > : ${phpFcgid_enable="NO"} > : ${phpFcgid_users="www"} > : ${phpFcgid_children="2"} > > start_cmd=phpFcgid_start > stop_cmd=phpFcgid_stop > > phpFcgid_start() { > echo "Starting $name." > export PHP_FCGI_CHILDREN=${phpFcgid_chidlren} > for user in ${phpFcgid_users}; do > socketdir="/tmp/.fastcgi.${user}" > mkdir -p ${socketdir} > chown ${user}:www ${socketdir} > chmod 0750 ${socketdir} > su -m ${user} -c "/usr/local/bin/php-cgi -b ${socketdir}/socket&" > done > } > > phpFcgid_stop() { > echo "Stopping $name." > pids=`pgrep php-cgi` > pkill php-cgi > wait_for_pids $pids > } > > run_rc_command "$1" > > Also put this to your /etc/rc.conf file: > > phpFcgid_enable='yes' > > -- > Sphinx of black quartz judge my vow. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > > Thanks Volodymyr, I appreciate it. Where would all of the FastCGI parameters go, such as # of children, timeout values, etc. -- View this message in context: http://www.nabble.com/Nginx-%2B-FastCGI-%2B-PHP5-on-FreeBSD-6.2-tf4389129.html#a12533660 Sent from the freebsd-questions mailing list archive at Nabble.com.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12533660.post>