tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
安装准备
yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -y
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install
cd ../
配置php
把源文件中的配置文件拷贝一份到编译后的Lib文件夹
[root@localhost php-5.3.27]# cp php.ini-
php.ini-development php.ini-production
[root@localhost php-5.3.27]# cp php.ini-production /application/php/lib/php.ini
[root@localhost php-5.3.27]#
进入apache配置文件 配置apache支持php
cd /application/apache/conf/
vim httpd.conf
##//311gg 311行增加动态php解析
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
检查语法 平滑重启
/application/apache/bin/apachectl –t
/application/apache/bin/apachectl graceful
测试Apache+php
<?php
##phpinfo();
//$link_id=mysql_connect('主机名','用户','密码');
$link_id=mysql_connect('localhost','root','123456') or mysql_error();
if($link_id){
echo "mysql successful by oldboy !";
}else{
echo mysql_error();
}
?>
本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/articles/8681690.html