MacOS 安装PHP5.6

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

php56

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

php56-fpm

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

原文地址:https://www.cnblogs.com/photo520/p/11619161.html

时间: 2024-08-30 07:32:38

MacOS 安装PHP5.6的相关文章

macOS 安装配置yaf框架 生成yaf项目

macOS 安装配置yaf框架 Yaf只支持PHP5.2及以上的版本. 并支持最新的PHP5.3.3 Yaf需要SPL的支持. SPL在PHP5中是默认启用的扩展模块 Yaf需要PCRE的支持. PCRE在PHP5中是默认启用的扩展模块 0.下载Yaf包 http://pecl.php.net/package/yaf 或 从 https://github.com/laruence/yaf 克隆源代码 cd Documents/www/ git clone https://github.com/l

在CentOS/RHEL 6.2上使用YUM安装PHP5.4

核心命令 rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm    yum install php54w 以下转自样例: php5.4于2012年5月8号发布,从php5.4.0开始php加入了一些新特色如: Traits支持 内置了一个简单的Web服务器 提供了数组简短语法 直接对函数返回值进行数组取值 最终删除魔术方法及安全模式 你可以在这里看到更新日志. 这里使用 Webtatic EL6的YUM源来安装php5.4,我们首页安装Web

CentOS安装PHP5.6

配置yum源: centos6.5: # rpm -Uvh  # rpm -Uvh centos7: 1安装EPEL源:EPEL源是centos下一个非常强大的扩展yum源(反正别人都这么说) 2安装REMI源:这个是用来安装和更新PHP的,由于有的东西(比如laravel框架)php的版本是有要求的,而centos默认安装的php版本是比较低的,因此我们通过这个yum源可以安装较新的php. # yum install epel-release # rpm -ivh http://rpms.f

ubuntu Server 安装 php5

ubuntu Server 安装 php5 1:如果你的服务器已经安装了apache2组件,那么在安装php5时,可以把对应apache2的php5组件一起安装 sudo apt-get install php5 libapache2-mod-php5 安装成功之后,可以看到,默认情况下,安装了 json,opcache,pdo,readline等模块 2:如果需要命令行运行 php5脚本需要安装 php5-cli 从上图之中,可以看到,默认已经安装了 php5-cli模块 可以使用 php5

ubuntu 16.04 LTS 安装 php5.6

卸载所有安装的 PHP: sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` 添加源: sudo add-apt-repository ppa:ondrej/php 安装php5.6: sudo apt-get updatesudo apt-get install php5.6 安装php组件:sudo apt-get install php5.6-mbstring php5.

CentOS 7 yum 安装php5.6

配置yum源 追加CentOS 6.5的epel及remi源. # rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 以下是CentOS 7.0的源. # yum install epel-release # rpm -ivh h

二、Ubuntu下编译安装PHP5.6.16

    在Ubuntu下搭建LNMP环境.编译安装mysql,nginx,php.最后在LNMP前提下安装composer,并且安装laravel框架.首先,第三步开始编译安装PHP5.6.16 1.先进入"/usr/local/src"文件夹中,接着键入 "sudo wget http://cn2.php.net/distributions/php-5.6.16.tar.gz"回车,等待下载完毕.下载完毕后,执行"sudo tar zxvf php-5.

三、Ubuntu下编译安装PHP5.6.16

    在Ubuntu下搭建LNMP环境.编译安装mysql,nginx,php.最后在LNMP前提下安装composer,并且安装laravel框架.首先,第三步开始编译安装PHP5.6.16 1.先进入"/usr/local/src"文件夹中,接着键入 "sudo wget http://cn2.php.net/distributions/php-5.6.16.tar.gz"回车,等待下载完毕.下载完毕后,执行"sudo tar zxvf php-5.

IIS下安装php5.3

前面装过一次PHP5.2,但PHP5.3与PHP5.2相比,变化很多. 由于PHP5.3的全新特效及改进,原有的isapi方式解析PHP脚本已经不被支持,PHP从5.3.0以后的版本开始使用微软的FastCGI模式,这是一个更先进的方式,运行速度更快,更稳定! 新版本的PHP5.3通过以往老方法已经不能在IIS上安装了,现在给出在IIS上安装PHP5.3以后版本的教程. 1,下载并安装 FastCGI Extension for IIS 6.0 and 5.1,下载地址:http://www.i