
Brew PHP Switcher ist ein einfaches Skript, mit dem Sie Ihre Apache- und CLI-Konfigurationen schnell zwischen den Hauptversionen von PHP wechseln können.
Wenn Sie mehrere Produkte/Projekte unterstützen, die entweder mit brandneuen oder alten Legacy-PHP-Funktionen erstellt wurden, und es für Sie mühsam ist, Konfigurationsdateien ständig zu ändern, wird der gesamte Prozess zu einem einzigen Befehl.
Nur für Benutzer von OSX, die PHP über Homebrew installiert haben und nur für PHP-Version 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 und 8.0.
In Ihrer Apache-Konfiguration muss das native OSX-PHP-Modul auskommentiert sein.
# LoadModule php5_module libexec/apache2/libphp5.soBrew PHP Switcher fügt den Speicherort des PHP-Moduls von Homebrew automatisch in der Apache-Konfiguration im folgenden Format hinzu.
# LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
# LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp8.so 2.3
brew install brew-php-switcherWenn 5.6 vorhanden ist, ersetzen Sie diese bitte durch die Syntax 5.6 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 8.0 , 8.1 , 8.2 , 8.3 oder 8.4, je nachdem, welche Version erforderlich ist.
brew-php-switcher 5.6Standardmäßig wird die Apache-Konfiguration geändert
-s|-s=* Überspringt den Apache- und Valet-Konfigurationsschalter für z. B # skip apache only
brew-php-switcher 5.6 -s
# skip valet only
brew-php-switcher 5.6 -s=valet
# skip valet & apache
brew-php-switcher 5.6 -s=valet,apache-c=* eine bestimmte Konfiguration umschalten, z. B # switch valet config only
brew-php-switcher 5.6 -c=valet
# switch valet & apache config only
brew-php-switcher 5.6 -c=valet,apache
# switch apache config only
brew-php-switcher 5.6 -c=apacheMIT