macbook安裝php環境的方法:先安裝brew;然後透過指令「brew install php@7.1」安裝php7.1;接著安裝mysql5.7以及nginx;最後透過start指令啟動PHP即可。
推薦:《PHP影片教學》
mac安裝php環境
安裝brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安裝php7.1
brew install php@7.1
安裝mysql5.7
brew install mysql@5.7
安裝nginx
brew install nginx
開始nginx
brew services start nginx
啟動PHP
brew services start php@7.1
啟動mysql
brew services start mysql@5.7 /usr/local/opt/mysql@5.7/bin/mysql.server start
php一些路徑
/usr/local/opt/php@7.1/bin/php /usr/local/Cellar/php@7.1/7.1.28/bin/phpize
php-fpm設定檔(php運行用戶在這裡改user和group)
/usr/local/Cellar/php@7.1/7.1.28/.bottle/etc/php/7.1/php-fpm.d/www.conf php.ini /usr/local/etc/php/7.1/php.ini nginx.conf /usr/local/etc/nginx/nginx.conf my.cnf /usr/local/etc/my.cnf
以上是macbook安裝php環境的方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!