- 论坛徽章:
- 0
|
其实这些教程网上有很多的,这是我自己这几天研究的,很多都是参考网上的教程,这里谢谢各位写网络教程的达人们。在这里需要说明的是,这只是我自己的安装编译过程,都是自己的一些经验。
好,我们进入正题。
所需软件:
Apache: httpd-2.2.10.tar.gz
MySQL: mysql-5.0.67.tar.gz
PHP: php-5.2.6.tar.gz
ZendOptimiter-3.3.3-linux-glibc23-i386.tar.gz
libpng-1.2.32.tar.gz
gd-2.0.36rc1.tar.gz
freetype2-.2.3.7.tar.bz2
curl-7.19.0.tar.gz
libxml2-2.7.2.tar.gz
jiegsrc.v6b.tar.gz
zlib-1.2.3.tar.gz
这些软件网上都有下载,我就不提供下载了,自己上Google找。
一、安装Apache:
# tar -zxvf httpd-2.2.10.tar.gz (tar 这个命令不懂的自己上Google查)
(其实在输入文件名时有个简单的技巧,按tab键补全。)
# cd httpd-2.2.10
#mkdir /usr/local/apache2 //建立一个apache2目录,这个目录是apahce的安装位置
#./configure --prefix=/usr/local/apache2 --enabel-so //./configure 这个可以加-h来提供帮助,所有的选项都有解释的。
#make;make clean;make install //这里加个make clean是防止以前有编译过的.
二、安装MySQL
#tar -zxvf mysql-5.0.67.tar.gz
#cd mysql-5.0.67
#groupadd mysql
#useradd -g mysql mysql
#mkdir /usr/local/mysql
#mkdir /usr/local/mysql/data
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --enable-assembler --with-charset=utf8 --with-extra-charsets=all-static--localstaticdir=/usr/local/mysql/data
#make clean,make,make install
#/usr/local/mysql/bin/mysql_install_db
三、安装GD库等软件
1、安装libxml2-2.7.2.tar.gz
#tar -zxvf libxml2-2.7.2.tar.gz
#cd libxml2-2.7.2
#mkdir /usr/local/modules
#mkdir /usr/local/modules/libxml
#./configure --prefix=/usr/local/modules/libxml
#make clean,make,make install
2、安装libpng-1.2.32.tar.gz
#tar -zxvf libpng-1.2.32.tar.gz
#cd libpng-1.2.32
#cp scripts/makefile.std makefile
编辑 makefile 将 prefix 改为 prefix=/usr/local/libpng2
#make
#mkdir /usr/local/modules/libpng
#make install
3、安装freetype2-2.3.7.tar.gz
#tar -zxvf freetype2-2.3.7.tar.gz
#cd freetype2-2.3.7
#mkdir /usr/local/modules/freetype
#./configure --prefix=/usr/local/modules/freetype
#make,make clean,make install
4、安装jpegsrc.v6b.tar.gz
#tar -zxvf jpegsrc.v6b.tar.gz
#cd jpegsrc.v6b
#mkdir /usr/local/modules/jpeg
#mkdir /usr/local/modules/jpeg/bin
#mkdir /usr/local/modules/jpeg/lib
#mkdir /usr/local/modules/jpeg/inculde
#mkdir /usr/local/modules/jpeg/man
#mkdir /usr/local/modules/jpeg/man/man1
#make install-lib
#make clean
#make
#make install
5,安装zlib-1.2.3.tar.gz
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib-1.2.3
#mkdir /usr/local/modules/zlib
#./configure --prefix=/usr/local/modules/zlib
#make clean
#make
#make install
6、安装curl-7.19.0.tar.gz
#tar -zxvf curl-7.19.0.tar.gz
#cd curl-7.19.0
#mkdir /usr/local/modules/curl
#./configure --prefix=/usr/local/modules/curl
#make,make clean,make install
7、安装gd-2.0.36rc1.tar.gz
#tar -zxvf gd-2.0.36rc1.tar.gz
#cd gd-2.0.36rc1
#mkdir /usr/local/modules/gd
#./configure --prefix=/usr/local/modules/gd --with-png=/usr/local/modules/libpng --with-freetype=/usr/local/modules/freetype --with-jpeg=/usr/local/modules/jpeg --with-zlib=/usr/local/modules/zlib
#make clean,make,make install
四、安装PHP
#tar -zxvf php-5.2.6.tar.gz
#cd php-5.2.6
#mkdir /usr/local/php5
#./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-zlib=/usr/local/modules/zlib --with-xml=/usr/local/modules/libxml --with-jpeg-dir=/usr/local/modules/jpeg --with-freetype-dir=/usr/local/modules/freetype--with-curl-dir=/usr/local/modules/curl --with-gd-dir=/usr/local/modules/gd
#make clea,make,make install
#cp php.ini-dist /usr/local/php5/etc/php.ini
添加PHP到Apache中
#vi /usr/local/apahce2/conf/httpd.conf
(1)在httpd.conf文件相应的地方添加下面几行(如果在安装php5时,有的配置可以已经加上了,就不需要再重新添加了)
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
在DirectoryIndex index.html index.html.var 后面添加index.php
六、安装Zend
#tar -zxvf zendoptimizer-3.3.3-linux-glibc23-i386.tar.gz
#cd zendoptimizer-3.3.3-linux-glibc23-1.386
#./install.sh
安装过程中,需要输入php.ini的位置,和确定Apache的位置。
安装都结束了,最后来测试。
在/usr/local/apache2/htdocs建立一个phpinfo.php
#vi /usr/local/apache2/htdocs/phpinfo.php
<?php
phpinfo();
?>
在浏览器里打开localhost\phpinfo.php如果没问题的话就会显示php的信息了。 |
|