64-bit centos 6.5 compiling and installing the lamp Environment

Source: Internet
Author: User
Tags php source code

    1. Mysql5.5.40 compilation and Installation

      See mysql5.5.40 compilation and Installation

    2. Apache 2.4.10 compilation and Installation

      For more information, see apache 2.4.10 compiling and installation.

    3. PHP 5.4.33 compilation and Installation


Next we will compile and install php5.4.33

First download the source code package to the user directory and download php5.4.33

You can also use the command line to download:

[[email protected] ~]# wget http://kr1.php.net/get/php-5.4.33.tar.bz2/from/this/mirror

Decompress the source code

[[email protected] ~]# tar -xvf php-5.4.33.tar.bz2 -C /usr/local/src/

Because some RPM packages required for PHP compilation are not in the default Yum source, we need to install the epel Yum source.

Install epel Yum Source:

[[email protected] ~]# wget [[email protected] ~]# rpm -ivh epel-release-6-8.noarch.rpm

After installing the epel Yum source, we will install some RPM packages required by PHP.

[[email protected] ~]# yum -y install libmcrypt libmcrypt-devel bzip2-devel libxml2 libxml2-devel

Then go to the PHP source code decompressed directory.

[[email protected] ~]# cd /usr/local/src/php-5.4.33/[[email protected] php-5.4.33]# ./configure --prefix=/usr/local/php-5.4.33 --with-mysql=/usr/local/mysql-5.5.40/ \ #MySQL安装目录--with-openssl=/usr/local/openssl-1.0.1i/ \ #OpenSSL安装目录--with-mysqli=/usr/local/mysql-5.5.40/bin/mysql_config --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --with-apxs2=/usr/local/httpd24/bin/apxs \ #指向Apache安装目录下/bin/apxs--with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-xml --enable-sockets --enable-maintainer-zts --enable-mbstring

Start configuration, after OK

[[email protected] php-5.4.33]# make && make install



Edit the Apache configuration file httpd. conf to enable Apache to support PHP

vim /etc/httpd24/httpd.conf

Add the following two lines

AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps

Go to directoryindex index.html

Change

DirectoryIndex index.php index.html

Then test

In a webpage File

Input

<? PHP

Phpinfo ();

?>

Restart the Web Server

service httpd restart

Open your webpage to see if it is displayed normally










This article is from the "imperial garden" blog, please be sure to keep this source http://diguojin.blog.51cto.com/5034509/1562633

64-bit centos 6.5 compiling and installing the lamp Environment

Related Article

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.