I'm using ubuntu 16.0.4 having nginx and php7.0-fpm installed on it. Is it possible to use another version of php for another project at the same time?
How should I change my nginx config file?
I'm using ubuntu 16.0.4 having nginx and php7.0-fpm installed on it. Is it possible to use another version of php for another project at the same time?
How should I change my nginx config file?
I usualy change the fastcgi_pass socket variable into my nginx conf file.
location ~ \.php$ {
...
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
....
}
Check the sock location for your php version. Mine (using Debian 9) can be located into /var/run/php/
cd /var/run/php
I currently have both php fpm 5.6 and 7.2 installed on my system, and the list command will output both php5.6-fpm.sock and php7.2-fpm.sock files.
You could then substitute the sock pointer into the nginx file:
location ~ \.php$ {
...
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
....
}
Remember to reload nginx afterwards:
sudo systemctl restart nginx