mac php安装 发表于 2022-07-04 | 分类于 IT技术-桌面/12345678910111213141516171819202122232425262728293031323334353637383940414243~ brew search php #搜索php==> Formulaebrew-php-switcher php@7.2 phplint pcpphp php@7.3 phpmd pupphp-code-sniffer php@7.4 phpmyadminphp-cs-fixer php@8.0 phpstanphp-cs-fixer@2 phpbrew phpunit➜ ~ brew install php@7.2 #安装php7.2#配置文件路径/usr/local/etc/php/7.2/php.ini/usr/local/etc/php/7.2/php-fpm.ini#重启服务brew services restart php@7.2#不在后台运行/usr/local/opt/php@7.2/sbin/php-fpm --nodaemonize➜ ~ vim /usr/local/etc/php/7.2/php-fpm.conf#去掉第17行和第24行前面的分号17 ;pid = run/php-fpm.pid #pid 文件就会自动产生在 /usr/local/var/run/php-fpm.pid24 ;error_log = log/php-fpm.log#测试php-fpm配置php-fpm -tphp-fpm -c /usr/local/etc/php/7.2/php.ini -y /usr/local/etc/php/7.2/php-fpm.conf -t#启动php-fpmphp-fpm -Dphp-fpm -c /usr/local/etc/php/7.1/php.ini -y /usr/local/etc/php/7.1/php-fpm.conf -D#关闭php-fpmkill -INT `cat /usr/local/var/run/php-fpm.pid`#重启php-fpmkill -USR2 `cat /usr/local/var/run/php-fpm.pid`#启动|停止|重启 PHPbrew services start|stop|restart php