[Tutorial] How to auto change Apache version after changing PHP version


  • administrators
    | 87399 points

    Create this file trigger-php.bat in usr\bin:

    \usr\bin\trigger-php.bat:

    php trigger.php %PHP_VERSION% %APACHE_VERSION%
    

    You can access PHP_VERSION and APACHE_VERSION through $argv in trigger.php in usr\bin:

    \usr\bin\trigger.ph:

    <?php
        print_r($argv);
        # YOUR CODE HERE
    

    In you code, you can download correspond Apache version from http://www.apachelounge.com/download/ and extract it to bin\apache


  • | 2527 points

    @leokhoa This may be an obvious question, but how do I change the Apache version inside of trigger.php? I understand that $argv will look something like this...

    array(2) {
      [0]=> "trigger.php"
      [1]=> "php-7.2.8-Win32-VC15-x64" // %PHP_VERSION%
      [2]=> "httpd-2.4.27-win64-VC14" // %APACHE_VERSION%
    }
    

    ...but how can I use that to tell Laragon to change the active Apache version (if applicable). I'm fine parsing the strings to get VC15 and VC14 out of them, but how would I tell Larago to change to, say, Apache httpd-2.4.34-win64-VC15? I'm only asking about the Laragon command. I'm good with the surrounding code needed.

    Thanks again!


  • administrators
    | 87399 points

    @pfaciana : You can change it in usr\laragon.ini.


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.