MacOS installed PHP5.6

After the MacOS Mojave system, if you want to install php5.6 version of the time, not with the brew install php5.6 installation, because in the new brew has been abandoned php5.6 and php7.0, Php if a brew search php search out minimum version is [email protected], so there can be installed in accordance with the relevant requirements of the following methods

Add Source
1
BREW TAP exolnet / homebrew-deprecated
search PHP
1
BREW Search PHP
install PHP
1
BREW install [email protected]
after installation will prompt the following information:

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

Guess you like

Origin www.cnblogs.com/photo520/p/11619161.html