步骤一:安装
#tar -zxvf php-5.2.17.tar.gz
#cd php-5.2.17
#./configure --prefix=/opt/php --with-mysql=/opt/mysql \
>--with-apxs2=/opt/httpd/bin/apxs //通俗易懂,不解释
#make
#make install
#make clean
#make distclean
步骤二:Apache中加载php模块
#cp php.ini-dist /usr/local/lib/php.ini
#vim httpd.conf
查看是否有下面这句话,没有则添加
LoadModule php5_module modules/libphp5.so
找到“#AddType application/x-gzip .gz .tgz”添加
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
步骤三:建立php测试文件
# vi /opt/httpd/htdocs/test.php
<?php
phpinfo();
?>
:wq
重启apache
[root@hadoop1 ~]# /usr/local/apache/bin/apachectl
stop
[root@hadoop1 ~]# /usr/local/apache/bin/apachectl
start