Lamp source installation of centos6.5 source code installation of the php5.6.9

Source: Internet
Author: User
Tags install php mcrypt zts zend

    • Download the php5.6.9 package and unzip it

[Email protected] ~]# wget http://cn2.php.net/distributions/php-5.6.9.tar.bz2

[Email protected] ~]# Tar XF php-5.6.9.tar.bz2

    • Compiling the installation

My compilation options are as follows

--prefix=/usr/local/php: Define the path to the installation

--with-mysql=/usr/local/mysql: Specify MySQL installation directory

--with-mysqli=/usr/local/mysql/bin/mysql_config

--with-openssl:include OpenSSL support (requires OpenSSL >= 0.9.6)

--enable-mbstring: Allows multi-byte string support, which supports fonts such as Chinese

--with-freetype-dir:set the path to freetype 2 install prefix

--with-jpeg-dir:gd:set the path to libjpeg install prefix

--with-png-dir:gd:set the path to libpng install prefix

--with-zlib:--with-zlib=dir Include zlib support (requires zlib >= 1.0.9)

--WITH-LIBXML-DIR=/USR: Must install LIBXML2 first

--enable-xml: Support Extended Markup Language

--enable-sockets: Support sockets

--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS: Building dynamic Module 2.0 support support, which means that in your/etc/httpd/ Httpd.conf., if you want to use fastcgi then replace with ENABLE-FPM

--with-mcrypt: Provides encryption support

--WITH-CONFIG-FILE-PATH=/ETC: Generate configuration file in/etc directory/etc/php.ini

--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D: There are sub-profiles under the/ETC/PHP.D directory

--WITH-BZ2: Supports BZ2 compression

--ENABLE-MAINTAINER-ZTS: Thread-supported module, if you use prefork do not include this option, you can display the currently loaded module by command httpd V

[Email protected] php-5.6.9]#./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl-- With-mysqli=/usr/local/mysql/bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir --with-zlib--with-libxml-dir=/usr--enable-xml--enable-sockets--with-apxs2=/usr/local/apache/bin/apxs-- With-mcrypt--with-config-file-path=/etc--with-config-file-scan-dir=/etc/php.d--with-bz2--enable-maintainer-zts

Because the software is too many, so compile first try

    • Thankfully, only one error has been reported, and some errors can be found in the article written by the eldest brother Http://www.jb51.net/article/37487.htm.

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

Download Libmcrypt,yum The original source is not inside, so go elsewhere to download

Download these four packages and install, if you do not want to download, please update yourself 163 or other sources, pro-Test http://jingyan.baidu.com/article/ D2b1d1027b76c75c7e37d4d0.html can, update quite long, about 2h, finally I can yum find these several packages, if you do not want to update the source, follow the steps below

[Email protected] ~]# wget {ftp://rpmfind.net/linux/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm,ftp:// RPMFIND.NET/LINUX/EPEL/6/X86_64/LIBMCRYPT-DEVEL-2.5.8-9.EL6.X86_64.RPM}

[Email protected] ~]# wget {ftp://rpmfind.net/linux/epel/6/x86_64/mhash-devel-0.9.9.9-3.el6.x86_64.rpm,ftp:// RPMFIND.NET/LINUX/EPEL/6/X86_64/MHASH-0.9.9.9-3.EL6.X86_64.RPM}

The middle may have said Nokey, and was neglected by me

Then recompile and try again, if the last few lines are create ... it's a success.

[[email protected] php-5.6.9]# Make&&make Install

[email protected] php-5.6.9]# CP Php.ini-production/etc/php.ini

  • Resolve the connection with the httpd, if not start, please turn off your firewall and SELinux OH

    A) Add AddType application/x-httpd-php. php. phtml on the specified line.

    b) Modify DirectoryIndex index.html index.php on the specified line

  • test php for normal operation

    [[email protected "Htdocs ]# cat index.php

    <BODY>

    </BODY>

    </HTML>

    <?php

    phpinfo ();

    ?>

    I can't do that. Many of the previously compiled modules are enabled and can be used

  • Testing the connection to MySQL

    [email protected] htdocs]# cat index.php

    if ($conn)

    echo "success!";

    Else

    echo "failure!";

    ?>

  • Install PHP xcache3.0 (responsible for accelerating the parsing of PHP code) extension

    Download the installation package, compile the installation

    The following section, available for php5.4

    [Email protected] ~]# wget http://xcache.lighttpd.net/pub/Releases/3.0.1/xcache-3.0.1.tar.gz

    [Email protected] ~]# Tar XF xcache-3.0.1.tar.gz

    [Email protected] ~]# CD xcache-3.0.1

    [Email protected] xcache-3.0.1]#/usr/local/php/bin/phpize #phpize是准备一个php扩展准备编译, the first level of inspection

    Configuring for:

    PHP Api version:20131106

    Zend Module Api no:20131226

    Zend Extension Api no:220131226

    compile specifies which extension (XCache), Php-config is responsible for parsing the extension and compiling, the equivalent of a review it

    [Email protected] xcache-3.0.1]#/configure--enable-xcache--with-php-config=/usr/local/php/bin/php-config

    [[email protected] xcache-3.0.1]# Make&&make Install


    /root/xcache-3.0.1/xcache.c:in function ' Zif_xcache_get_special_value ':

    /root/xcache-3.0.1/xcache.c:324:error: ' Is_constant_array ' undeclared (first use of this function)

    /root/xcache-3.0.1/xcache.c:324:error: (Each undeclared identifier was reported only once

    /root/xcache-3.0.1/xcache.c:324:error:for each function it appears in.)

    Make: * * * [Xcache.lo] Error 1


    The above content will be error, because php5.6 xcache3.0 does not support, so the official website to download the latest version, so still more to the official website or the authoritative site better

    [Email protected] ~]# wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz


[Email protected]~]# tar xzf xcache-3.2.0.tar.gz

[[Email protected]~]# CD xcache-3.2.0

[[Email protected]]#/usr/local/php/bin/phpize

Configuringfor:

Phpapi version:20131106

Zendmodule Api no:20131226

Zendextension Api no:220131226

[[Email protected]]#./configure--enable-xcache--with-php-config=/usr/local/php/bin/php-config

[[email protected]] #make &&make Install

Installingshared Extensions:/usr/local/php/lib/php/extensions/no-debug-zts-20131226/

Finally installed, it appears that the compilation environment and software version should be considered

Place the master configuration file in the PHP The Fragment configuration squad

[[Email protected]]# MKDIR/ETC/PHP.D

[Email protected]]# CP xcache.ini/etc/php.d/

Modify /etc/php.d/xcache.ini the specified place in the file

extension=/usr/local/php/lib/php/extensions/no-debug-zts-20131226/xcache.so

Restart Service

[[Email protected]]# service httpd restart

STOPPINGHTTPD: [OK]

STARTINGHTTPD: [OK]

Open Web page again discover with this module support

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/1D/wKioL1V0Rj2SdGGTAAKBC87VTRw390.jpg "title=" 123. JPG "alt=" wkiol1v0rj2sdggtaakbc87vtrw390.jpg "/>

This article is from the "Learning Path of Kai Learning" blog, please make sure to keep this source http://qixue.blog.51cto.com/7213178/1659482

Lamp source installation of centos6.5 source code installation of the php5.6.9

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.