From owner-freebsd-questions@FreeBSD.ORG Thu Sep 6 23:58:04 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E847216A41B for ; Thu, 6 Sep 2007 23:58:04 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id CD00313C481 for ; Thu, 6 Sep 2007 23:58:04 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ITREa-00078S-F3 for freebsd-questions@freebsd.org; Thu, 06 Sep 2007 16:58:04 -0700 Message-ID: <12533660.post@talk.nabble.com> Date: Thu, 6 Sep 2007 16:58:04 -0700 (PDT) From: Peter Pluta To: freebsd-questions@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: peter@placidpublishing.net References: <12513880.post@talk.nabble.com> Subject: Re: Nginx + FastCGI + PHP5 on FreeBSD 6.2 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2007 23:58:05 -0000 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.