系统环境:各种开发工具包都装上,再加上这些小的开发软件,不然GD装不上去,PHP也自然装不上去。
bzip2-devel zlib-devel libjpeg-devel libpng-devel freetype-devel openssl-devel
libxml2-devel gettext-devel (可从光盘中安装,也可用YUM命令来安装)
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd
make
make install
tar zxvf httpd-2.2.6.tar.gz
cd httpd-2.2.6
./configure --prefix=/usr/local/apache --with-ssl --enable-ssl --enable-so --enable-rewrite
# --enable-so 动态加载库 (PHP是动态的,所以要开启)
make install
1:在/etc/rc.d/rc.local文件中加入一行
/usr/local/apache/bin/apachectl start
这样每次重新启动系统时以后,apache也会随系统一起启动
2:或者将apache安装为系统服务
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
然后 vi /etc/rc.d/init.d/httpd添加(#!/bin/sh 下面)
# chkconfig:2345 10 90 (其中10代表优先启动的级别,90代表优先被杀进程的级别)
# description: Activates/Deactivates Apache Web Server
最后,运行chkconfig 把 Apache 添加到系统的启动服务组里面:
chkconfig --add httpd
chkconfig httpd on
tar zxvf mysql-5.0.46.tar.gz
cd mysql-5.0.46
./configure --prefix=/usr/local/mysql --with-comment=Source --with-server-suffix=-enterprise-gpl --with-mysqld-user=mysql --without-debug --with-socket-path=/var/lib/mysql/mysql.sock --with-big-tables --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=all --with-pthread --enable-static --enable-thread-safe-client --with-client-ldtlags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --without-innodb --without-ndb-debug --without-isam --enable-local-infile --with-readline --with-raid --sysconfdir=/etc --localstatedir=/var/lib/mysql
出错:checking for termcap functions library... configure: error: No curses/termcap library found
请安装:ncurses和ncurses-devel两个包
InnoDB表驱动是一种存储引擎,它的特性是支持事务,适合企业级用户,想安装这个表驱动要加上(--with-plugins=innobase)
# --prefix=/usr/local/mysql mysql数据库的安装目录
# --with-mysqld-user=mysql mysql数据库的运行用户
# --with-charset=utf8 --with-collation=utf8_general_ci mysql数据库的默认字符集
# --sysconfdir=/etc my.ini配置文件的路径
# --localstatedir=/var/lib/mysql 数据库存放的路径
make install
/usr/local/mysql/bin/mysql_install_db
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysql /var/lib/mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 3 mysqld on
use mysql;
UPDATE user SET Password = password ( 'chris!benq7*' ) WHERE User = 'root' ;
5: 安装php5
tar zxvf php-5.2.5.tar.gz
cd phhp-5.2.5
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-zlib-dir --with-bz2 --with-libxml-dir --with-gd=/usr/local/gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-ttf --enable-mbstring --with-mysql=/usr/local/mysql --with-config-file-path=/etc --with-iconv --disable-ipv6 --enable-static --enable-zend-multibyte --enable-inline-optimization --enable-zend-multibyte --enable-sockets --with-openssl --with-gettext --enable-ftp
# --with-mysql=/usr/local/mysql mysql数据库的安装路径
# --with-gd=/usr/local/gd gd库的安装路径
# --with-config-file-path=/etc php配置文件(php.ini)的存放路径
# --disable-ipv6 取消ipv6功能
# --with-openssl 开启加密功能
# --enable-fastcgi 开启PHP的fastcgi模式
make install
cp php.ini-recommended /etc/php.ini
vi /usr/local/apache/conf/httpd.conf
找到DocumentRoot "/usr/local/apache/htdocs"和<Directory "/usr/local/apache/htdocs">改成自己的文件存放目录
# Options Indexes FollowSymLinks
找到这一段
# AllOverride controls what directives may be placed in .htaccess files.
# It cat be "ALL","None", or any combination of the keywords;
# Options Filelnfo AuthConfig Limit
#
AllowOverride none
更改为:AllowOverride all
AddType application/x-httpd-php .php
使用PHP探针测试
phpinfo();
?>
6: 安装Zend
解压Zend的之后,运行命令 ./install.sh ,按要求一步一步安装下去
eaccelerator 是PHP的加速软件,使用后PHP的执行效率会有较大幅度的提升。目前eaccelerator和Zend能够基本上兼容。
ZendOptimizer没有加速功能,反而使PHP运行变慢,只是起到个运行Zend加密文件的作用而以。
cd eaccelerator-0.9.5.2
export PHP_PREFIX="/usr/local/php"
$PHP_PREFIX/bin/phpize
make
make install
修改php.ini (安装完Zend之后,php.ini配置文件将存放于/usr/local/Zend/etc目录下)
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
重启apache,查看php探针,在Zend信息那块会出现eaccelerator相关的信息,这时表明eaccelerator加速软件安装成功。