• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MacOS安装PHP5.6

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

MacOS Mojave 系统之后,如果想安装 php5.6 版本的时候,无法用brew install php5.6 安装,因为在新的 brew 中已经废弃了 php5.6 和 php7.0,如果使用 brew search php 搜索出来的Php版本最低是 [email protected] 的,所以有相关需求的可以按照下面方法安装

添加源
1
brew tap exolnet/homebrew-deprecated
搜索PHP
1
brew search php
安装PHP
1
brew install [email protected]
安装完后会提示如下信息:

1
2
==> [email protected]
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
<FilesMatch .php$>
SetHandler application/x-httpd-php

Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/5.6/
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.bash_profile
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

To have launchd start exolnet/deprecated/[email protected] now and restart at login:
brew services start exolnet/deprecated/[email protected]
Or, if you don't want/need a background service you can just run:
sudo php-fpm
配置环境变量
vim ~/.bash_profile

1
2
3
4

export PATH=/usr/local/Cellar/php56/5.6.40/bin:$PATH

php56-fpm

export PATH=/usr/local/Cellar/php56/5.6.40/sbin:$PATH


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ERROR:Unabletoglobalize'/usr/local/NONE/etc/php-fpm.d/*.conf'问题的解决发布时间:2022-07-10
下一篇:
手把手教您搭建Apache下的PHP环境发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap