81971834 2013-08-10
安装ncurses
# yum install ncurses-devel -y
# tar -zxvf ncurses-5.9.tar.gz
# ./configure
# make
# make install
安装 zlib包:
找到相应的下载地址:
http://sourceforge.net/projects/libpng/files/zlib/1.2.7/
$tar -xvzf zlib-1.2.3.tar.gz
$cd zlib-1.2.3.tar.gz
$./configure
$make
$make install
安装mysql
tar zxvf mysql-3.23.58.tar.gz
cd mysql-3.23.58
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql
./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --with-extra-charsets=gbk,gb2312,utf8
make
make install
#prefix=/usr/local/mysql mysql安装的目标目录
#sysconfdir=/etc my.ini配置文件的路径
#localstatedir=/var/lib/mysql 数据库存放的路径
安装php
yum install libxml2 libxml2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel libtool-ltdl-devel tar -jxvf php-5.3.6.tar.bz2 cd php-5.3.6 #./configure --prefix=/usr/local/php -with-apxs2=/usr/local/httpd/bin/apxs --with-curl --with-mcry#pt --enable-mbstring ./configure --prefix=/usr/local/php -with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-zlib make && make install 这样报错: configure: error: mcrypt.h not found. Please reinstall libmcrypt.
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz #tar -zxvf mcrypt-2.6.8.tar.gz #cd mcrypt-2.6.8 #LD_LIBRARY_PATH=/usr/local/lib ./configure #make & make install
然后再安装PHP
有时候会出现这样的错误
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/php/include/php/ext/pdo/
解决方案:
rm -rf /usr/local/php/lib/php/.channels
/usr/local/php/bin/pecl update-channels
然后再安装PHP
配置httpd.conf使支持 php
1.httpd.conf配置2. 安装 Apache
2.1 拷贝 Apache 源码包(比如:httpd-2.2.3.tar.gz)到 /usr/local/src 目录下并安装
#cd /usr/local/src
#tar -zxvf httpd-2.2.3.tar.gz
#cd httpd-2.2.3
// 安装路径、提供DSO支持、支持地址重写功能
#./configure --prefix=/usr/local/httpd --enable-module=so --enable-module=rewrite
#make && #make install
#/usr/local/httpd/bin/apachectl start // 启动 apache
#/usr/local/httpd/bin/apachectl stop // 停止 apache
#/usr/local/httpd/bin/apachectl restart // 重启 apache