mac os high sierra下搭建php多版本-php5.2+php5.6-nginx

xampp的apache彻底启动不来了。

 

php52的编译参数

./configure --prefix=/usr/local/Cellar/php52bysk/ --with-config-file-path=/usr/local/Cellar/php52bysk/etc --with-iconv  --with-zlib  --enable-xml --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2l --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-mime-magic --enable-session --with-mcrypt

 

 

 

MacBookPro:~ showker$ brew search php56

==> Searching local taps...

==> Searching taps on GitHub...

==> Searching blacklisted, migrated and deleted formulae...

It was migrated from josegonzalez/php to homebrew/core.

MacBookPro:~ showker$ brew tap josegonzalez/homebrew-php

Updating Homebrew...

MacBookPro:~ showker$ brew install php56

 

 

 

 

 

This formula is keg-only, which means it was not symlinked into /usr/local,

because Apple's CLT package contains apr.

 

If you need to have this software first in your PATH run:

  echo 'export PATH="/usr/local/opt/apr/bin:$PATH"' >> ~/.bash_profile

 

 

To enable PHP in Apache add the following to httpd.conf and restart Apache:

    LoadModule php5_module /usr/local/opt/php@5.6/lib/httpd/modules/libphp5.so

 

    <FilesMatch .php$>

        SetHandler application/x-httpd-php

    </FilesMatch>

 

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/

 

This formula 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 this software first in your PATH run:

  echo 'export PATH="/usr/local/opt/php@5.6/bin:$PATH"' >> ~/.bash_profile

  echo 'export PATH="/usr/local/opt/php@5.6/sbin:$PATH"' >> ~/.bash_profile

 

For compilers to find this software you may need to set:

    LDFLAGS:  -L/usr/local/opt/php@5.6/lib

    CPPFLAGS: -I/usr/local/opt/php@5.6/include

 

 

To have launchd start php@5.6 now and restart at login:

  brew services start php@5.6

Or, if you don't want/need a background service you can just run:

  php-fpm

 

 

===

安装mysql

To have launchd start mysql now and restart at login:

  brew services start mysql

Or, if you don't want/need a background service you can just run:

  mysql.server start

原文地址:https://www.cnblogs.com/showker/p/9018876.html