Skip to content

Instantly share code, notes, and snippets.

@wgm89
Last active December 19, 2015 18:49
Show Gist options
  • Select an option

  • Save wgm89/6001874 to your computer and use it in GitHub Desktop.

Select an option

Save wgm89/6001874 to your computer and use it in GitHub Desktop.
upgrade php5.3 to php 5.4
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5
upgrading PHP to 5.4 gives 502 Bad Gateway errors.
fix:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ ^/(app|app_dev)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
becomes this:
# pass the PHP scripts to FastCGI server at /var/run/php5-fpm.sock
location ~ ^/(app|app_dev)\.php(/|$) {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment