Mysql5.5.40 compilation and Installation
See mysql5.5.40 compilation and Installation
Apache 2.4.10 compilation and Installation
For more information, see apache 2.4.10 compiling and installation.
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