搭建LAMP环境(源码方式)(3)

第三步,安装PHP

--1.解压
[root@serv02 ~]# tar -xf php-5.3.6.tar.bz2 -C/usr/src/
--2.进入/usr/src/php-5.3.6/目录,配置
[root@serv02 php-5.3.6]# cd/usr/src/php-5.3.6/
[root@serv02 php-5.3.6]# ./configure —help
[root@serv02 php-5.3.6]# ./configure--prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs--with-MySQL-sock=/tmp/mysql.sock --with-mysql=/usr/local/mysql/
 
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found.Please check your libxml2 installation.
#如果出现上述错误,安装libxml2
[root@serv02 php-5.3.6]# yum install libxml2*-y
 
+--------------------------------------------------------------------+
| License:                                                          |
| This software is subject to the PHPLicense, available in this    |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of thislicense agreement.    |
| If you do not agree with the terms of thislicense, you must abort |
| the installation process at thispoint.                            |
+--------------------------------------------------------------------+
#如果出现如下文本,则证明配置成功
 
Thank you for using PHP.
 
--3.编译
[root@serv02 php-5.3.6]# make
 
--4.安装
[root@serv02 php-5.3.6]# make install
 
--5.拷贝php.ini文件,修改httpd.conf文件
[root@serv02 bin]# cp php.ini-development/usr/local/php5/lib/php.ini
[root@serv02 bin]# grep -e"AddHandler" -e "AddType" /usr/local/apache/conf/httpd.conf
  AddHandler php5-script .php
AddType text/html .php

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/45f0c23677b995a6f75e2091fa2ebba9.html