Cent OS 6.3 compiled and installed PHP 5.6

Source: Internet
Author: User
Tags mcrypt xml parser



installation package (network address)

C language XML Parser class library LIBXML2 http://pan.baidu.com/s/1eQhIQf4 

OpenSSL class Library http://pan.baidu.com/s/1ntqYa4h

bzip2 Http://pan.baidu.com/s/1gdjcKQv

zlib Http://pan.baidu.com/s/1dDgyYTr

Libcurl http://pan.baidu.com/s/1c06j336

JPEG class Library http://pan.baidu.com/s/1mg3RqWw

libpng class Library Http://pan.baidu.com/s/1eQuAdhC

Libfreetype class Library http://pan.baidu.com/s/1mgpEgOg

Libxslt class Library Http://pan.baidu.com/s/1dDEoYit

PHP 5.6 Source Http://pan.baidu.com/s/1mgEGDk8


After all the packages have been downloaded, put them under/url/local and unzip them and install them.

Installing LIBXML2

./configure--with-python=no

Make && make install

Installing OpenSSL

./configure

Make && make install

Installing BZIP2  

Make && make install


Installing zlib

./configure

Make && make install


Installing Curl

./configure

Make && make install


Installing Lib JPEG

./configure

Make && make install


Installing Lib png

./configure

Make && make install


Installing Lib FreeType

./configure

Make && make install


Installing Lib MCrypt

./configure

Make && make install


Installing LIBXSLT

./configure

Make && make install

Install Httpd-devel (/USR/SBIN/APXS)

First which APXS find Apxs, if not found Apxs install Httpd-devel

Yum Install Httpd-devel


Install PHP

./configure--prefix=/usr/local/php \

--with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/etc/conf.d \
--enable-fpm \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-zlib \
--with-xmlrpc \
--with-xsl \
--with-openssl \
--with-mysql \
--with-mysqli \
--with-pdo-mysql \

--WITH-APXS2=/USR/SBIN/APXS \
--disable-debug \
--enable-zip \
--enable-sockets \
--ENABLE-SOAP \
--enable-mbstring \
--enable-inline-optimization \
--enable-xml \
--ENABLE-FTP \
--ENABLE-EXIF \
--ENABLE-WDDX \
--enable-bcmath \
--enable-calendar \
--ENABLE-SHMOP \
--ENABLE-DBA \
--enable-sysvsem \
--ENABLE-SYSVSHM \

--enable-sysvmsg


Make && make install

Add a soft chain

Ln-s/usr/local/php/bin/php/usr/local/bin.

Testing the soft chain

[Email protected] php]# ln-s/usr/local/php/bin/php/usr/local/bin/

[Email protected] php]# php-v

PHP 5.6.10 (CLI) (Built:jun 18 2015 19:52:16)

Copyright (c) 1997-2015 the PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

[Email protected] php]#.

Test Success

Libphp5.so context settings for running dependent class libraries

    chcon-t texrel_shlib_t    /usr/local/lib/libfreetype.so.6

              /usr/local/lib/libpng16.so.16

          chcon-t texrel_shlib_t   /usr/lib/httpd/modules/libphp5.so (this sentence can not be executed)

echo/usr/local/lib >>/etc/ld.so.conf & Ldconfig


Note: The service httpd start run may appear /usr/local/lib/libfreetype.so.6:cannot restore segment prot after Reloc:permission de Nied and other errors, the above command is to ensure that the Apache boot libphp5.so module run the Dependent class library can load normally, to ensure that Apache load libphp5.so after the normal startup of the settings

Configuration file Modification

Configuration file PHP.ini modified. At the time of installation, we configured the configuration file installation directory to/usr/local/php/etc from the source directory to copy the configuration file to this directory

Cp/usr/local/php-5.6.10/php.ini-development/usr/local/php/etc/php.ini


This article is from the "more interest than Love" blog, please be sure to keep this source http://xiaohuazi.blog.51cto.com/8034597/1663820

Cent OS 6.3 compiled and installed PHP 5.6

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.