Configuring website to work on older version of PHP using Homestead
Hi guys, I'm trying to set up the environment for running Laravel site on Homestead. I'm using 8.1.2 PHP Version and this site needs to be on 7.3. What I did is in my Homestead.yaml file I specified the php version like this:
php: "7.3" and run vagrant provision. After that in vagrant ssh, in project directory tried to run composer install and npm install but I'm getting errors and when I try to open the site I'm getting this:
This page isn’t working ... is currently unable to handle this request.
HTTP ERROR 500
@vajricaaaa You also need to specify the version of PHP when running Composer commands inside the VM, otherwise it will use the default CLI version of PHP (which will be PHP 8.1 or something).
You can run Composer commands for your 7.3 website like this:
php7.3 /usr/local/bin/composer install
This will use PHP 7.3 to run Composer and ensure you’re only installed 7.3-compatible versions of packages. If you’re still getting errors after doing this, then you’ll need to look in your site’s error log file at storage/logs/laravel.log