LAMP+Tomcat+Discuz+WordPress 【PHP的安装】

FTP地址:ftp://www.linuxidc.com

用户名:

密码:

在 2011年LinuxIDC.com\7月\LAMP+Tomcat+Discuz+WordPress 【PHP的安装】

下载方法见这里

[root@localhost LAMP]# tar zxvf zlib-1.2.5.tar.gz 
[root@localhost zlib-1.2.5]#cd zlib-1.2.5
[root@localhost zlib-1.2.5]#./configure --prefix=/usr/local/zlib/
[root@localhost zlib-1.2.5]#make
[root@localhost zlib-1.2.5]#make install


[root@localhost LAMP]#tar zxvf freetype-2.4.3.tar.gz 
[root@localhost freetype-2.4.3]#cd freetype-2.4.3
[root@localhost freetype-2.4.3]#./configure --prefix=/usr/local/freetype
[root@localhost freetype-2.4.3]#make
[root@localhost freetype-2.4.3]#make install

[root@localhost LAMP]#tar zxvf libpng-1.5.2.tar.gz 
[root@localhost LAMP]#cd libpng-1.5.2
[root@localhost libpng-1.5.2]#./configure
[root@localhost  libpng-1.5.2]#./configure 【最好指定路径】
[root@localhost libpng-1.5.2]#make
[root@localhost libpng-1.5.2]#make install


[root@localhost LAMP]#tar -zxvf jpegsrc.v8c.tar.gz 
[root@localhost LAMP]#cd jpeg-8c/
[root@localhost  jpeg-8c]#mkdir -p /usr/local/jpeg/bin
[root@localhost  jpeg-8c]#mkdir -p /usr/local/jpeg/lib
[root@localhost  jpeg-8c]#mkdir -p /usr/local/jpeg/include
[root@localhost  jpeg-8c]#mkdir -p /usr/local/jpeg/man/man1
[root@localhost jpeg-8c]#./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
[root@localhost  jpeg-8c]#make
[root@localhost  jpeg-8c]#make install


[root@localhost LAMP]#tar zxvf gd-2.0.33.tar.gz 
[root@localhost LAMP]#cd gd-2.0.33
[root@localhost gd-2.0.33]#./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-png --with-zlib
[root@localhost gd-2.0.33]#make
[root@localhost gd-2.0.33]#make install

安装PHP

[root@localhost LAMP]#tar zxvf php-5.3.6.tar.gz 
[root@localhost LAMP]#cd php-5.3.6
[root@localhost LAMP]#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-gd=/usr/local/gd --enable-gd --enable-gd-native-ttf --with-jpeg-dir=/usr/local/jpeg --with-png --with-ttf --with-zlib --with-freetype-dir=/usr/local/freetype --enable-magic-quotes --with-MySQL=/software/mysql --with-mysql-sock=/tmp/mysql.sock --with-iconv --with-mbstring --enable-mbstring --enable-track-vars --enable-force-cgi-redirect --enable-ftp --with-config-file-path=/usr/local/php/etc --with-pear=/usr/local/php/pear --enable-sockets --with-mail --with-xml
[root@localhost LAMP]#cd /LAMP/php-5.3.6/
[root@localhost LAMP]#cp php.ini-development  /usr/local/php/etc/php.ini 【cp php-x.x.x/php.ini-dist /opt/php/etc/php.ini   新版的 php.ini-development相当于旧版本的php.ini-dist】
[root@localhost LAMP]#vim php.ini 

修改配置文件vim  /usr/local/php/etc/php.ini:
register_globals = On

然后编写php测试页info.php:内容如下:

<?php
phpinfo();
?>



查看/usr/local/apache/conf/httpd.conf文件,看是否存在语句(如果安装的Php5):
LoadModule php5_module        modules/libphp5.so
如果存在,即说明apache已经成功加载了php模块;

【重启apache服务】
# apachectl restart
将info.php放置到/usr/local/apache/htdocs 目录下;
# chmod 755 info.php
在浏览器中能在该页面中看到php的信息则说明安装成功!
注:启用了SELinux的FC或RedHat会提示权限问题并导致Php无法正常工作,禁用SELinux后重启系统即可解决问题。

相关阅读:
LAMP+Tomcat+Discuz+WordPress【安装前的准备】
LAMP+Tomcat+Discuz+WordPress【JDK的安装】
LAMP+Tomcat+Discuz+WordPress【Apache的安装】
LAMP+Tomcat+Discuz+WordPress【MySQL的安装】
LAMP+Tomcat+Discuz+WordPress 【PHP的安装】
LAMP+Tomcat+Discuz+WordPress 【Tomcat的安装整合】

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

转载注明出处:http://127.0.0.1/wyypxy.html