Leveraging Laragon’s features to effortlessly switch PHP & Apache version in your PC (Windows OS) for software development.
Why do I need that?
The main reason is because I’ve to work on a legacy system which is running on previous version of PHP
5.3. But I still need the latest version of PHP
7.0 in my machine for other projects.
How I handle this situation?
I have been using Laragon since I changed my development machine to Windows instead of MacOS about a year ago. Since Laravel Valet is not available in Windows, Laragon is the best alternative.
I found that Laragon provide a really good features to easily manage virtual server and yes, it supports multiple version of PHP! It works like a charm.
- Download Laragon Wamp and install it.
- Open the application and you should be able to see this panel.
Menu > PHP > Version [php-7.2...] > How to add another PHP versionto open a short tutorial provided in Laragon Forum.
- Follow those simple steps and now you can have multiple version of PHP in your development machine.
- Now if you switch the PHP version to let say
php-5.5.0-Win32-VC11-x64, Laragon will prompt a warning saying that PHP & Apache are not compatible. See image below.
- To fix this incompatible, you also need to add another version of Apache that are compatible with PHP indicated by same number of VC.
Menu > Apache > Version [...] > How to add another Apache versionto open another short tutorial provided in Laragon Forum.
- Follow those simple steps and after that switch to the compatible Apache version and click
Start Allbutton to run the server.
I hope this sharing could help any of my friends who are facing the same situation. If there is any other tools out there that can solve this problem more efficient and effective, feel free to drop a comment and let me know. I really appreciate that.
Thank you for reading.