Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple php versions in Laravel Forge at the same time

I have several laravel apps that use different PHP versions (7.0, 7.1, 7.3, 7.4). Dependencies depend on those versions, and I don't have the opportunity to upgrade them. How can I install all needed PHP versions without breaking any default laravel forge configurations and functionality?

like image 663
lipazo Avatar asked Dec 07 '25 05:12

lipazo


1 Answers

yes you can, just change fastcgi_pass to the php-fpm version you want to use.

e.g.

/etc/nginx/sites-available/yoursite.com

location ~ \.php$ {
    ...
    fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}

I also recommend changing your deployment hooks if you use any to use the same php.

php7.3 artisan route:cache
like image 59
Diego Antunes Avatar answered Dec 08 '25 20:12

Diego Antunes