•
10 min read
Homestead PHP-FPM Aliases
Laravel Homestead comes prepackaged with a number of aliases (shortcuts for commands) one of which is php81
. Calling this will execute the following commands:
This only changes the CLI version of PHP - the web server version is not affected.
Let’s create our own function to take a PHP version number and optional test site url to change.
Here’s a summary of the steps:
- Open the
aliases
file from your Homestead directory - Add the function and save the file
- Re-provision the Homestead VM
vagrant reload --provision
Creating the function
Now you can run the command from your project root
If you want to keep your functions consistent with Homestead’s aliases you can create a function for each version:
and use in the same way: