Mac安装PHP环境
1、安装brew
/bin/zsh -c "$(curl -fsSLhttps://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
选择1中科大源根据提示完成安装
2、安装Nginx
brew install Nginx
3、安装MysqL
brew install MysqL
4、安装PHP
#查看可安装版本
brew search PHP
#存在7.4,安装之
brew install PHP@7.4
echo 'export PATH="/usr/local/opt/PHP@7.4/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/PHP@7.4/sbin:$PATH"' >> ~/.zshrc
source ~/.zshrc
https://www.cnblogs.com/ihuangjianxin/p/10185266.html
#http://pecl.PHP.net/package/redis
解压安装包
tar -xzvf redis-4.*.tgz
cd redis-4.*/
PHPize
./configure --with-PHP-config=/usr/local/opt/PHP\@7.*/bin/PHP-config
编译
make
make install
文件位置:/usr/local/etc/PHP/7.2/PHP.ini文件内容添加下面这行
重启PHP完成安装
6、安装redis
到此简单记录下Mac安装PHP环境的过程,后续有时间再丰富一下细节内容。更多相关信息,请关注微信公众号:技术大番薯。不定期更新。
1人点赞