I tried upgrading php from 5.6 to 7.2 following the instructions here.
Installation went fine and checking php -v indicated that my php version was now 7.2.
The final step (Updating Nginx Site to Use New Socket Path) calls for editing the php location block in the sites-enabled/default configuration file from:
fastcgi_pass unix:/var/run/php5-fpm.sock;
to
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;.
Every line of my sites-enabled/default configuration file has been commented out since it was created. My main server configuration is located in sites-available and named “mydomain.com” (there is a shortcut to it located in the “sites-enabled” folder). There was no existing reference to the php5.6 location in this file so I’m not sure how it even worked before this. Adding the following code did not appear to do anything as indicated in my Digital Ocean graphs which showed memory use by php5.6:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I restarted nginx after each edit/troubleshooting attempt.
I stupidly tried purging php5.6 to remove it and that caused my site to go down (502 Bad Gateway). I attempted to reinstall php5.6 and remove php7.2 but the site is still down and I can’t figure out why. My server configuration file is the same as it was before attempting the php upgrade and php -v indicates the php version is 5.6
I realize I should have taken a snapshot before but I’m an idiot.
Any advice, tips or guidance would be greatly appreciated. I’m desperate to get my site back online.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I figured it out using this as a guide
https://www.digitalocean.com/community/questions/nginx-error-111-connection-refused?answer=28237