Compile and install lamp (iii)--compile and install php-5.4.13

Source: Internet
Author: User

1, to resolve the dependency relationship:
If you want to have the compiled PHP support mcrypt extension, you need to download the following two RPM packages and install them:
libmcrypt-2.5.7-5.el5.i386.rpm
libmcrypt-devel-2.5.7-5.el5.i386.rpm

Note: www.rpmfind.net

2. Compile and install php-5.4.13
First download the source package to the local directory, download location ftp://172.16.0.1/pub/Sources/new_lamp.

# Tar XF php-5.4.13.tar.bz2# cd php-5.4.13#./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# make# make test# make Intall

Description
(1, here in order to support the Apache worker or event of the two mpm, compile using the--ENABLE-MAINTAINER-ZTS option.
(2, if you use PHP5.3 or above, in order to link the MySQL database, you can specify MYSQLND, so that you do not need to install the MySQL or MySQL development package in this machine first. MYSQLND is available from PHP 5.3 and can be bound to it at compile time (instead of relying on the specific MySQL client library bindings), but it is the default setting starting with PHP 5.4.

#./configure--with-mysql=mysqlnd--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd

(3 、--with-apxs2=/usr/local/apache/bin/apxs to compile PHP into a httpd module, if you want to combine fcgi mode with HTTP you need to replace this with--ENABLE-FPM


To provide a configuration file for PHP:

# CP Php.ini-production/etc/php.ini

3, edit Apache configuration file httpd.conf, with Apache support PHP

# vim/etc/httpd/httpd.conf

1, add the following two lines
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
2. Locate to DirectoryIndex index.html
Modified to:
DirectoryIndex index.php index.html
Then restart httpd, or let it reload the configuration file to test if PHP is already working.

Compile and install lamp (iii)--compile and install php-5.4.13

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.