多重PHP環境 on Mac with Homebrew

多重PHP環境 on Mac with Homebrew
Read Time:30 Second

原文:https://getgrav.org/blog/macos-catalina-apache-multiple-php-versions

各php.ini位置

/usr/local/etc/php/5.6/php.ini
/usr/local/etc/php/7.0/php.ini
/usr/local/etc/php/7.1/php.ini
/usr/local/etc/php/7.2/php.ini
/usr/local/etc/php/7.3/php.ini
/usr/local/etc/php/7.4/php.ini

切換php版本(範例:斷開7.4,改用5.6)

~% brew unlink php@7.4 && brew link --force --overwrite php@5.6

啟動Webserver

~% sudo brew services start httpd

停止 Webserver

~% sudo brew services stop httpd

重啟Webserver

~% sudo brew services restart httpd