|
  
|
1#
发表于 2008-3-5 12:37
| 只看该作者
apache2 php5 mysql5 gd2的安装
apache2 php5 mysql5 gd2
#gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)
请下载以下所有的东西:
httpd-2.2.0.tar.gz http://www.apache.org
php-5.1.1.tar.gz http://www.php.net
ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz http://www.zend.com gd-2.0.27.tar.gz
libxml2-2.6.26.tar.gz
zlib-1.2.3.tar.gz
jpegsrc.v6b.tar.gz ftp://ftp.uu.net/graphics/jpeg/
libpng-1.2.8-config.tar.gz http://www.libpng.org/pub/png/libpng.html
freetype-2.1.10.tar.gz http://www.fretype.org
安装MYSQL 服务器:
groupadd mysql
useradd -g mysql mysql
cd /usr/local
tar zxvf /usr/local/file/MySQL5.tar.gz
mv mysql-standard-5.0.18-linux-i686-glibc23 mysql
cd mysql
scripts/mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/data
chgrp -R mysql /usr/local/mysql
chown -R root /usr/local/mysql/bin
cp support-files/my-medium.cnf /etc/my.cnf
bin/safe_mysqld --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
安装XPM (如果你没有安装x-win,也就是图形介面,那么这一步就跳过)
rpm -ivh xpm-3.4k-2.i386.rpm --force
rpm -ivh xpm-devel-3.4k-2.i386.rpm --force
安装libxml
tar zxvf libxml2-2.6.26.tar.gz
cd libxml2-2.6.26
./configure --prefix=/usr/local/libxml2
make
make install
cp /usr/local/libxml2/bin/xml2-config /usr/bin/xml2-config
安装zlib
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib2
make
make install
安装jpeg
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --prefix=/usr/local/jpeg6
make
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/lib
make install-lib
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/man
mkdir /usr/local/jpeg6/man/man1
make install
安装libpng:
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
./configure --prefix=/usr/local/libpng2
make
make install
安装freetype:
tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure --prefix=/usr/local/freetype2
make
make install
安装gd库:
tar zxvf gd-2.0.27.tar.gz
cd gd-2.0.27
./configure --prefix=/usr/local/gd2 --with-zlib=/usr/local/zlib2/ --with-png=/usr/local/libpng2/ --with-jpeg=/usr/local/jpeg6/ --with-xml2=/usr/local/libxml2/ --with-freetype=/usr/local/freetype2/
(请指定及格插件的安装路径,否则安装php的时候可能出错!)
引用
** Configuration summary for gd 2.0.26:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Xpm library: yes
Support for pthreads: yes
make
引用
make[2]: *** [gd_png.lo] Error 1
make[2]: Leaving directory `/usr/local/file/gd-2.0.26gif'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/file/gd-2.0.26gif'
make: *** [all] Error 2
(如里这里有错误,请vi gd_png.c,找到“png.h”改成“/usr/local/libpng2/include/png.h”)
make install
安装apache,(php5安装环境需要apache2.0.46以上版本,下载的时候注意!)
tar zxvf httpd-2.2.0.tar.gz
cd httpd-2.2.0
./configure --prefix=/usr/local/apache2 --enable-module=so
make
make install
安装php5:
tar zxvf php-5.1.1.tar.gz
cd php-5.1.1
./configure --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng2/ --with-xml2=/usr/local/libxml2/ --with-gd=/usr/local/gd2/ --with-freetype-dir=/usr/local/freetype2/ --enable-trace-vars --with-zlib-dir=/usr/local/zlib2/ --with-mysql=/usr/local/mysql
引用
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
make
make install
复制PHP.INI文件到正确位置
在PHP目录下运行
cp php.ini-dist /usr/local/php/lib/php.ini
vi /usr/local/apache2/conf/httpd.conf
要改的有如下几处:
一般都在(LoadModule php5_module modules/libphp5.so)下添加下面一行
AddType application/x-httpd-php .php
还有找到(DirectoryIndex index.html index.html.var)
改成
(DirectoryIndex index.html index.html.var)
找到
# don't use Group #-1 on these systems!
把下面的用户名和组改为
User apache
Group apache
(原来好像是nobody)
再找
#ServerName
把#去掉,后面的IP改成你的IP.
找到所有(DocumentRoot "/usr/local/apache2/htdocs" )
把/usr/local/apache2/htdocs改为你存放网页文件的路径
保存httpd.conf文件.
启动apache
/usr/local/apache2/bin/apachectl start
安装ZEND
tar zxvf ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.0-linux-glibc21-i386
./install.sh
输入你的php.ini的路经(如:/etc/)
然后一路默认就可以了!
至此全部安装完成,以上如有错误请回贴留言,我再改正 |
|