Apple Mac OS X compile and install PHP

Source: Internet
Author: User
Tags mcrypt
OS X Yosemite 10.10.3 comes with a PHP version of 5.5.20, holding the spirit of tossing and the control of the installation details, the author by compiling the installation of the system to add a new version of the current 5.6.8 Versions of PHP, and open some of the common extension modules.

This compilation installs, the purpose is to use for Nginx, runs PHP through the FastCGI way, constructs the OS X under the LNMP environment.

Download the dependencies required in the Install compilation option

All dependent libraries are compiled and installed to the/usr/local/lib path, and are created manually if the path does not exist.

Libmhash (encryption Extension Library)

# download page: http://sourceforge.net/projects/mhash/# Current version: http://ncu.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/ mhash-0.9.9.9.tar.gz$ tar zxvf mhash-0.9.9.9.tar.gz$ cd mhash-0.9.9.9$./configure--prefix=/usr/local/lib/libmhash$ make$ sudo make install

Libmcrypt (encryption Extension Library)

# download page: http://mcrypt.hellug.gr/lib/# Current version: ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/ libmcrypt-2.5.7.tar.gz$ tar zxvf libmcrypt-2.5.7.tar.gz$ cd libmcrypt-2.5.7$./configure--prefix=/usr/local/lib/ libmcrypt$ make$ sudo make install

Libiconv (character encoding conversion library)

# download page: http://www.gnu.org/software/libiconv/# current version: Http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz$ tar ZXVF libiconv-1.14.tar.gz$ cd libiconv-1.14$./configure--prefix=/usr/local/lib/libiconv$ make$ sudo make install

Libpng (PNG image processing, GD library dependency)

# download page: http://www.libpng.org/pub/png/libpng.html# Current version: http://ncu.dl.sourceforge.net/project/libpng/libpng16/ 1.6.17/libpng-1.6.17.tar.gz$ tar zxvf libpng-1.6.17.tar.gz$ cd libpng-1.6.17$./configure--prefix=/usr/local/lib/ libpng$ make$ sudo make install

Libjpeg (jpg image processing, GD library dependency)

# download page: http://www.ijg.org/# current version: http://www.ijg.org/files/jpegsrc.v9a.tar.gz$ tar zxvf jpegsrc.v9a.tar.gz$ cd jpeg-9a$ ./configure--prefix=/usr/local/lib/libjpeg$ make$ sudo make install

Compiling and installing PHP

$ tar zxvf php-5.6.8.tar.gz$ cd php-5.6.8$./configure \    --prefix=/usr/local/php \    --with-config-file-path=/ usr/local/php \    --with-mysql \    --with-mysqli \    --enable-pdo \    --with-pdo-mysql \    -- With-mysql-sock=/tmp/mysql.sock \    --enable-opcache \    --enable-cgi \    --enable-fpm \    -- enable-sockets \    --enable-mbstring \    --enable-mbregex \    --enable-bcmath \    --enable-xml \    - -enable-zip \    --with-zlib \    --with-gd \    --with-png-dir=/usr/local/lib/libpng \    --with-jpeg-dir =/usr/local/lib/libjpeg \    --with-openssl \    --with-curl \    --with-mhash=/usr/local/lib/libmhash \    --with-mcrypt=/usr/local/lib/libmcrypt \    --with-iconv=/usr/local/lib/libiconv$ make$ sudo make install$ sudo cp php.ini-development/usr/local/php/php.ini$ cd/usr/local/php/etc$ sudo cp php-fpm.conf.default php-fpm.conf

The above steps are not error cases, the new PHP here even if the installation is successful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.