From owner-freebsd-questions@FreeBSD.ORG Thu Sep 6 01:04:37 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 5CABF16A417 for ; Thu, 6 Sep 2007 01:04:37 +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 46D8013C442 for ; Thu, 6 Sep 2007 01:04:37 +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 1IT5mn-0002Bh-BB for freebsd-questions@freebsd.org; Wed, 05 Sep 2007 18:03:57 -0700 Message-ID: <12513880.post@talk.nabble.com> Date: Wed, 5 Sep 2007 18:03:57 -0700 (PDT) From: Peter Pluta To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: peter@placidpublishing.net Subject: 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 01:04:37 -0000 Has anyone sucessfully got this running? I haven't been able to get this to work. I've looked at the numerous guides i've found on Google both in Russian and in English. I'm trying to use php's default fastcgi spawner and it's just not working. I've tried editing the bash script, but it won't start (I changed few things around and changed it to sh). I'm pretty much stumped now and want to just run it on Apache with mod_fcgid, but before I do that I want to be sure I can't get it to work. :working: Script: #!/bin/sh ## ABSOLUTE path to the PHP binary PHPFCGI="/usr/local/bin/php-cgi" ## tcp-port to bind on FCGIPORT="9000" ## IP to bind on FCGIADDR="127.0.0.1" ## number of PHP children to spawn PHP_FCGI_CHILDREN=2 ## number of request before php-process will be restarted PHP_FCGI_MAX_REQUESTS=500 # allowed environment variables sperated by spaces ALLOWED_ENV="PATH USER" ## if this script is run as root switch to the following user USERID=nginx ################## no config below this line if test x$PHP_FCGI_CHILDREN = x; then PHP_FCGI_CHILDREN=5 fi ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_CHILDREN" ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS" ALLOWED_ENV="$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS" if test x$UID = x0; then EX="usr/bin/su -c $USERID \"$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\"" else EX="$PHPFCGI -b $FCGIADDR:$FCGIPORT" fi echo $EX # copy the allowed environment variables E= for i in $ALLOWED_ENV; do E="$E $i=${!i}" done # clean environment and set up a new one nohup env - $E sh -c "$EX" &> /dev/null & If anyone has a better method of getting it to work please do share it. I'd like to get it to work and possibly write a small guide aim'd at FreeBSD users. Thanks, Sasha -- View this message in context: http://www.nabble.com/Nginx-%2B-FastCGI-%2B-PHP5-on-FreeBSD-6.2-tf4389129.html#a12513880 Sent from the freebsd-questions mailing list archive at Nabble.com.