Ways to recompile Mamp PHP

Source: Internet
Author: User
Tags gettext imap install homebrew mcrypt openssl postgresql


The PHP version of Mamp is compiled without the--enable-debug option, so I'm going to recompile php myself so that I can use GDB to view the core dump file when I do my php extension research.

First use the PHP version in Mamp to view Phpinfo ()
Got the Mamp at compile time parameters

--more--
And added the--enable-debug option to the back.

sudo './configure '--with-mysql=mysqlnd '--with-gd '--with-jpeg-dir=/applications/mamp/library '--with-png-dir= /applications/mamp/library '--with-zlib '--with-zlib-dir=/applications/mamp/library '--with-freetype-dir=/ Applications/mamp/library '--prefix=/applications/mamp/bin/php/php5.5.26 '--exec-prefix=/applications/mamp/bin /php/php5.5.26 '--sysconfdir=/applications/mamp/bin/php/php5.5.26/conf '--with-config-file-path=/applications/ Mamp/bin/php/php5.5.26/conf '--enable-ftp '--enable-gd-native-ttf '--with-bz2=/usr '--with-ldap =mysqlnd '--with-t1lib=/applications/mamp/library '--enable-mbstring=all '--with-curl=/applications/mamp/ Library '--enable-sockets '--enable-bcmath '--with-imap=shared,/applications/mamp/library/lib/imap-2007f '-- Enable-soap '--with-kerberos '--enable-calendar '--with-pgsql=shared,/applications/mamp/library/pg '-- Enable-exif '--with-libxml-dir=/usr/include '--with-gettext=shared,/applications/mamp/library '--with-xsl=/APplications/mamp/library '--with-pdo-mysql=mysqlnd ' '--with-pdo-pgsql=shared,/applications/mamp/library/pg '-- With-mcrypt=shared,/applications/mamp/library '--with-openssl '--enable-zip '--with-iconv=/applications/mamp/ Library '--enable-opcache '--enable-cgi '--enable-intl '--with-icu-dir=/applications/mamp/library '--with-tidy =shared '--enable-wddx '--with-libexpat-dir=/applications/mamp/library '--enable-debug
Create a new directory for the downloaded PHP version and unzip it in the following folder

/applications/mamp/bin/php/php5.5.26/include/php

First compile an error for the first time using the above argument:

Configure:error:Cannot find OpenSSL ' s <evp.h>
Use

Brew Link OpenSSL--forece
Compile again, and get the following error

Configure:error:jpeglib.h not found
Install Jpeglib with Brew

sudo brew install Jpeglib
and then the error.

Configure:error:png.h not found
sudo brew install T1lib
Error

Configure:error:Cannot Locate header File Libintl.h
Use the following to solve

sudo brew install GetText
1) Installation GetText:

Brew Install GetText
2) Edit Configure file
Will:

For i in $PHP _gettext/usr/local/usr; Todo
Change to:

For i in $PHP _gettext/usr/local/usr/usr/local/opt/gettext; Todo
3) rerun./configure

Error

Configure:error:utf8_mime2text () has new signature, but U8t_canonical is missing. This should is not happen. Check Config.log For additional information
Installation

sudo brew install Imap-uw
Error

Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
Installation

sudo brew install Libmcrypt
Error

Configure:error:Cannot find Libpq-fe.h. Please specify correct PostgreSQL installation path
Installation

sudo brew install PostgreSQL
After

sudo make && sudo make install
Can not find the error libxml/parse.h

Change into

/usr/include/libxml2
Install Iconv

sudo brew install Homebrew/dupes/libiconv
In the repair Libiconv error, an article on the Internet to write mobile/use/lib/directory libiconv.* moved to other directories, replace just installed Libiconv to cross compile, the result just moved the system crashed. This library should be the system many program calls library, spent a night to reload a system, intends to use Docker to install a PHP environment tomorrow.

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.