PHP Compilation Installation

Source: Internet
Author: User

PHP Official: http://www.php.net/downloads.php

Download PHP:

[Email protected] httpd-2.2.16]# CD/USR/LOCAL/SRC

[Email protected] src]# wget http://am1.php.net/distributions/php-5.3.27.tar.gz

Extract:

[Email protected] src]# tar zxf php-5.3.27.tar.gz


To configure the compilation parameters:

[Email protected] src]# CD php-5.3.27

[Email protected] php-5.3.27]#/configure \

--prefix=/usr/local/php \

--WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS \

--WITH-CONFIG-FILE-PATH=/USR/LOCAL/PHP/ETC \

--with-mysql=/usr/local/mysql \

--with-libxml-dir \

--WITH-GD \

--with-jpeg-dir \

--with-png-dir \

--with-freetype-dir \

--with-iconv-dir \

--with-zlib-dir \

--WITH-BZ2 \

--WITH-OPENSSL \

--with-mcrypt \

--ENABLE-SOAP \

--ENABLE-GD-NATIVE-TTF \

--enable-mbstring \

--enable-sockets \

--ENABLE-EXIF \

--disable-ipv6


In this step, you encounter the following error:


Configure:error:xml2-config not found. Please check your LIBXML2 installation.

The solution is:

Yum Install-y libxml2-devel


There are also errors:

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


The solution is:

Yum Install-y OpenSSL Openssl-devel


Error:

Checking for BZIP2 in default path ... not found

Configure:error:Please Reinstall the BZIP2 distribution


Workaround:

Yum install-y bzip2 Bzip2-devel


Error:

Configure:error:png.h not found.


Workaround:

Yum install-y libpng Libpng-devel


Error:

Configure:error:freetype.h not found.


Workaround:

Yum install-y FreeType Freetype-devel


Error:

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


Workaround:

Rpm-ivh "http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"

Yum Install-y libmcrypt-devel


Compile:

[[email protected] php-5.3.27]# make



Installation:

[[email protected] php-5.3.27]# make install


Copy the configuration file:

[email protected] php-5.3.27]# CP Php.ini-production/usr/local/php/etc/php.ini


PHP Compilation Installation

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.