Virink's Blog logo

Virink's Blog

Let life be beautiful like summer flowers, and death like autume leaves.

 Make and install php 5.6.28 for mac

Install Brewhome

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Mysql

brew install mysql

Install Nginx

brew install nginx

Download php-src

You can do it by git or http

git

git clone https://github.com/php/php-src.git

http

http://php.net/downloads.php

Install PHP

brew install autoconf openssl libpng libjpeg libxml gettext libmcrypt libiconv libmhash

cd path/php-src(what you save)
buildconf --force

Configure

./configure \
--prefix=/usr/local/php56 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--without-apache \
--with-openssl=/usr/local/Cellar/openssl/1.0.2j \
--with-config-file-path=/etc \
--with-curl \
--with-bz2 \
--with-zlib \
--with-zlib-dir \
--with-mcrypt \
--with-mysql \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-imap-ssl \
--with-gettext \
--with-pear \
--with-gettext \
--with-pear \
--with-freetype-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-xmlrpc \
--with-xsl \
--with-pcre-regex \
--with-sqlite3 \
--enable-exif \
--enable-zip \
--enable-ftp \
--enable-soap \
--enable-sockets \
--enable-pdo \
--enable-cli \
--enable-calendar \
--enable-mbstring \
--enable-bcmath \
--enable-mbregex \
--enable-fpm \
--enable-gd-native-ttf \
--enable-xml \
--enable-libxml \
--enable-sysvsem \
--enable-debug

make and install

sudo make && make install

Setting

Write it in .zshrc (I used zsh)

export PATH="/usr/local/php56/bin:/usr/local/php56/sbin:$PATH"

Rewrite your configure:

  • /etc/php.ini
  • /etp/php-fmp.conf
  • /usr/local/etc/nginx/nginx.conf
    • add include vhost/*.conf in http{}
    • mkdir /usr/local/etc/nginx/vhost
    • vim your site setting in vhost/yourname.conf

Start Services

php-fpm -y /etp/php-fmp.conf -D
brew services start mysql
brew services start nginx
本文标题 : Make and install php 5.6.28 for mac
文章作者 : Virink
发布时间 :  
最后更新 :  
本文链接 : https://www.virzz.com/2016/11/27/make_and_install_php_5.6.28_for_mac_osx.html
转载声明 : 转载请保留原文链接及作者。
转载说明 : 本卡片有模板生成,本人转载来的文章请忽略~~