Build a PHP environment on mac

Source: Internet
Author: User
: This article mainly introduces how to build a PHP environment on mac. For more information about PHP tutorials, see. 1. install various plug-ins first. The first is the command line tool. after the terminal is opened, enter xcode-select-install and install it with your consent. The second is HomeBrew, terminal input ruby-e "$ (curl-fsSL https://raw.github.com/Homebrew/homebrew/go/install )"

Third install autoconf, enter brew install autoconf

2. start importing PHP packages in Mac.

Terminal input./buildconf -- force

. /Configure -- prefix =/usr/local/php7 -- with-apxs2 =/usr/sbin/apxs -- enable-fpm -- with-fpm-user = www -- with-fpm-group = www -- with-mysqli -- with-pdo-mysql -- with-iconv-dir -- with-freetype-dir -- with-jpeg-dir -- with-png-dir -- with-zlib -- -libxml-dir =/usr -- enable-xml -- disable-rpath -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- enable-xml- mbregex -- enable-mbstring -- with-mcrypt -- enable-ftp -- with-gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable- sockets -- with-xmlrpc -- enable-zip -- enable-soap -- without-pear -- with-gettext -- disable-fileinfo -- enable-maintainer-zts

3. Solve the error

1) configure: error: Cannot find OpenSSL's

Brew install openssl

Brew link openssl-force

2) configure: error: Invalid Lib. h not found.

Brew install libjpeg

3) configure: error: png. h not found.

Brew install libpng

4) freetype

Go to the official open-source support site of Apple: http://www.apple.com/opensource/find and download the zlib/libpng/jpeg/freetype/libgd file of gd1_. here we provide a package and execution script:

Tar-zxf gd.tar.gz

Cd gd

Sudo./install

4) configure: error: Cannot locate header file libintl. h

Install gettext

Sudo brew install gettext

Edit The configure file and find the path $ PHP_GETTEXT/usr/local/usr followed by gettext $ PHP_GETTEXT/usr/local/opt/gettext.

5) configure: error: mcrypt. h not found. Please reinstall libmcrypt.

Brew install wget

Http://www.tuicool.com/articles/yaQnmi2

The above describes how to set up a PHP environment for mac, including some content, and hope to help those who are interested in the PHP Tutorial.

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.