PHP Version & Apache Version are not compatible
-
I get the Warning "Your PHP Version & Apache Version are not compatible" when switching to a PHP version with a different VC (i.e. PHP 7.1 VC14 x64 to PHP 5.6 VC11 x64). So I go and get the Apache version with the correct VC and everything works great.
However, my question is, can I make a script/some code that whenever I change PHP versions, it also changes the Apache version to the one with the same VC at the same time. At present, I can not switch PHP versions without getting that warning, followed by continuous "httpd.exe" error windows. Is this normal? Am I doing something wrong? Previously I've used WampServer, and I never had to worry about different VCs, so I'm new to this type of management.
To recap, I can successfully change PHP versions (and Apache versions). Just not without warning and error windows popping up in the process when the VCs are temporarily not compatible.
Thanks!
-
@pfaciana : The VC compatibility is very important when you use Apache (mod_php). Therefore, Laragon shows a warning and from the warning, you know how to fix.
Which WAMP, it hides this so sometimes you have no clue your setup does not work.
-
@leokhoa Thanks for the response! So my question is, can I make a script/some code in Laragon that whenever I change PHP versions, it also changes the Apache version to the one with the same VC at the same time. Like hooking on to some sort of event/trigger/publish-subscribe. Possible something in a Procfile? Not sure, just thinking out loud. I don't mind if its something that I'd hard code the versions in the script file.
-
@pfaciana : Procfile's for another purpose. I will implement it in next version of Laragon.
-
@leokhoa Wow, that would be great! Thanks so much.
-
@pfaciana : I've released Laragon 3.4:
https://forum.laragon.org/topic/1072/laragon-3-4-released-composer-1-7-1-auto-trigger-when-changing-php-version-new-command-line-laragon-create-blank-project-nameIt will auto trigger
usr\bin\trigger-php.bat
when you change PHP version.
There are 2 environment variables you may need:- %PHP_VERSION%
- %APACHE_VERSION%
-
@leokhoa : Thanks! I see the the env variables and that the trigger-php.bat gets executed on PHP version change, but I could not find the command that deals with changing an Apache version. Is there a post on all the laragon commands? I only found
laragon reload
(Side question: what is the recommended way to upgrade? just re-install over the existing instance?)
Thanks!
-
@pfaciana:
Side answer:
The easiest way is just download and overwrite the laragon.exe from https://github.com/leokhoa/laragon
You can also download and install using the installer without any worries.You can implement your own code to change Apache version yourself. I've made a tutorial here:
https://forum.laragon.org/topic/1073/tutorial-how-to-auto-change-apache-version-after-changing-php-version