Welcome! Log In Create A New Profile

Advanced

Re: php exits with 502 Bad Gateway

February 19, 2012 02:05PM
Sorry for missing that conf. portion.

....the fastcgi_params file

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

#fastcgi_param HTTPS $server_https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;



... and the entire php-fcgi file

#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000

PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USR=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
PHP_CONFIG_FILE=/etc/php5/cgi/php.ini

start() {
echo -n "Starting PHP FastCGI: "
start-stop-daemon --quiet -- start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
RETVAL=$?
echo "$PHP_CGI_NAME."
}
stop() {
echo -n "Stopping PHP FastCGI: "
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo "$PHP_CGI_NAME."
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: php-fastcgi {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL


Thanks for your help!
Fouwaaz
Subject Author Posted

php exits with 502 Bad Gateway

mfouwaaz February 18, 2012 09:25PM

Re: php exits with 502 Bad Gateway

fbhosted February 19, 2012 11:22AM

Re: php exits with 502 Bad Gateway

fbhosted February 19, 2012 11:22AM

Re: php exits with 502 Bad Gateway

mfouwaaz February 19, 2012 02:05PM

Re: php exits with 502 Bad Gateway

mfouwaaz February 19, 2012 03:37PM

Re: php exits with 502 Bad Gateway

fbhosted February 19, 2012 02:12PM

Re: php exits with 502 Bad Gateway

mfouwaaz February 19, 2012 02:18PM

Re: php exits with 502 Bad Gateway

fbhosted February 19, 2012 02:48PM

Re: php exits with 502 Bad Gateway

Edho Arief February 19, 2012 08:34PM

Re: php exits with 502 Bad Gateway

mfouwaaz February 21, 2012 11:23PM

Re: php exits with 502 Bad Gateway

fbhosted February 22, 2012 01:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready