I have a server that is still running PHP 7.4.x
I, therefore, need to install laravel 8.x (the current version of laravel is 9.x) with laravel-sail. Since I don't have PHP running on the laptop I am using for development, I cannot install laravel with composer.
When I run the install command curl -s "https://laravel.build/example-app?with=mysql" | bash
then laravel 9.x is installed.
How can I make laravel-sail install laravel 8.x?
apokryfos's comment got me thinking and I tried the following
curl
commandThat worked. My composer.json looks like this
... and with
sail up
, I have a Laravel v8.83.9 up and running.For some reason, the PHP version is still 8.1, but I can change the PHP version in the docker-compose.yml to PHP 7.4 and rebuild. With that, I have (PHP v7.4.28).
Update: I originally thought adding a "laravel=8" to the
curl
command would load laravel in version 8.x, but this had no effect. Adding php=74 is enough to get laravel in version 8.x, but it does not set PHP to version 7.4. That needs to be done in the docker-compose.yml file.