MacOS搭建Apache+PHP环境

MacOS配置环境变量

参考: https://www.cnblogs.com/mingaixin/p/6281795.html?ivk_sa=1024320u

配置PHP环境变量

  1. sudo vi ~/.bash_profile
  2. export PATH="/Applications/MAMP/bin/php/php5.4.10/bin:$PATH"
  3. source ~/.bash_profile

安装php

参考:https://blog.csdn.net/weixin_41827162/article/details/119213381

Apache命令

  • 重启apache:sudo /usr/sbin/apachectl restart
  • 关闭apache:sudo /usr/sbin/apachectl stop
  • 开启apache:sudo /usr/sbin/apachectl start

nginx命令

  • 启动nginx: brew services start nginx
  • 关闭nginx: brew services stop nginx
  • 重启nginx: brew services restart nginx

posted on 2022-04-05 13:37  朝朝暮Mu  阅读(114)  评论(0)    收藏  举报