红联Linux门户
Linux帮助

redhat9+apache+mysql+php+zend安装(成功版)

发布时间:2006-09-11 00:35:28来源:红联作者:nxfte
Zend Optimizer是由PHP核心引擎“Zend”创建者Zend技术公司所开的免费PHP优化软件。据Zend公司透露使用这个软件某些情况下至少可以提高性能30%以上!这么好的免费大餐当然要用,

-----------------------------------------------
系统:red hat linux 9.0

step1:

apache:httpd-2.0.58.
[各种版本请去http://apache.justdn.org/httpd下载]
http://apache.justdn.org/httpd/httpd-2.0.58.tar.gz

PHP 4.4.1
[可在官方下载5.1.1和4.4.2两个版本http://www.php.net/downloads.php]
http://cn.php.net/get/php-4.4.1.tar.gz/from/cn2.php.net/mirror

MySQL Database Server 5.0.22
[各种版本可在mysql官方下载到 http://downloads.mysql.com/archives.php]
[url]http://downloads.mysql.com

Zend Optimizer 2.6.0
[Zend Optimizer各种版本请见:downloads.zend.org]
ZendOptimizer-2.6.0-linux-glibc21-i386.tar.gz
http://downloads.zend.org/
(ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz我开始使用这个没有成功!后来换了前面的2.6.0就成功了)
全部wget完毕

step2:

安装环境如果不确定的朋友,用rpm查一下
如果原来编译安装的,删了即可,放那也没事

[code]rpm qa | grep apache
rpm qa | grep mysql
rpm qa | grep php[/code]
再顺便查查

[code]rpm -qa | grep zlib
rpm -qa | grep libpng
rpm -qa | grep freetype
rpm -qa | grep jpeg
rpm -qa | grep gd[/code]
出来的结果必须有以下rpm包成功安装的前提!如果没有就到 http://rpmfind.net/linux/RPM/index.html 搜索吧!

[code][root@localhost local]# rpm -qa | grep zlib
zlib-1.1.4-8
zlib-devel-1.1.4-8
[root@localhost local]# rpm -qa | grep libpng
libpng-1.2.2-16
libpng-devel-1.2.2-20
libpng10-1.0.13-8
libpng10-devel-1.0.13-8
[root@localhost local]# rpm -qa | grep freetype
freetype-devel-2.1.3-6
freetype-2.1.3-6
[root@localhost local]# rpm -qa | grep jpeg
libjpeg-6b-26
libjpeg-devel-6b-26
[root@localhost local]# rpm -qa | grep gd
gdk-pixbuf-0.18.0-7
gdb-5.3post-0.20021129.18
gdbm-1.8.0-20
sysklogd-1.4.1-12
gdk-pixbuf-gnome-0.18.0-7
gdbm-devel-1.8.0-20
gd-1.8.4-11[/code]
因为我要装discuz,所以需要gd支持水印

安装顺序:mysql > apache > php > zend

step3:具体安装
1,mysql

[code]cd /usr/local
groupadd mysql
useradd -g mysql mysql
cd /usr/local
tar zxvf mysql-standard-5.0.22-linux-i686.tar.gz
ln -s mysql-VERSION-OS 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
bin/safe_mysqld --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
copy一个执行脚本
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start[/code]
此时,若你安装成功的话,会有如下提示:Starting MySQL SUCCESS!

2,apache
cd ..
返回/usr/local目录

[code]tar zxvf httpd-2.0.58.tar.gz
cd httpd-2.0.58
./configure --prefix=/usr/local/apache --enable-so[/code]
编译apache,加上加载模块参数

[code]make
make install
/usr/local/apache/bin/apachectl start[/code]
显示httpd (pid xxxxx) already running
[code]ps -ef | grep httpd[/code]
看看是否有httpd进程

[code]vi /usr/local/apache/conf/httpd.conf[/code]
配置一下conf脚本
在http.conf最末端找到

[code]#
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#
[/code]
复制,添加在最后去掉#修改为

[code]
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www
ServerName 192.168.1.1
ServerAlias 192.168.1.1
[/code]
3,php

[code]cd ..
tar xzvf php-4.4.1.tar.gz
cd php-4.4.1
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql --with-config-file-path=/usr/local/php/etc --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --enable-mbstring
make
make install
cp php.ini-recommended /usr/local/php/lib/php.ini //(这种也是可以的,我使用的就是这种)
#cp php.ini-dist /usr/local/php/lib/php.ini //(有的用户使用这种)[/code]

修改php.ini文件,全局注册变量改为开启

[code]vi /usr/local/php/lib/php.ini
register_globals = On
vi /usr/local/apache/conf/httpd.conf[/code]
//编辑文件,加入php文件头支持
找到

[code]DirectoryIndex index.html index.html.var[/code]
改为

[code]DirectoryIndex index.php index.html index.html.var[/code]
找到

[code]AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz[/code]
改为

[code]AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php[/code]
4,zend

[code]cd ..
tar xzvf ZendOptimizer-2.6.0-linux-glibc21-i386.tar.gz
cd ZendOptimizer-2.6.0-linux-glibc21-i386
# ./install.sh[/code]
mud安装过程中会要你输入php.ini的路径:/usr/local/php/etc/php.ini
我们已经在安装php的时候将php.ini-recommended脚本复制过去了
只需确定/usr/local/php/etc即可

最后

[code]/usr/local/apache/bin/apachectl restart[/code]
在/home/wwwroot目录下保存为/index.php测试下:

[code]echo 'installing linux+apache+mysql+php+zend success';
?>
phpinfo();
?>;[/code]
打开浏览器,输入http://192.168.1.1
installing linux+apache+mysql+php+zend success
以及phpinfo()的内容!

[code]This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.9, Copyright (c) 2003-2005, by Zend Technologies with Zend Optimizer v2.6.0, Copyright (c) 1998-2005, by Zend Technologies

Zend Optimizer
Optimization Pass 1 enabled
Optimization Pass 2 enabled
Optimization Pass 3 enabled
Optimization Pass 4 enabled
Optimization Pass 9 disabled
Zend Loader enabled
License Path no value[/code]
文章评论

共有 2 条评论

  1. yangjinlong1123 于 2011-03-25 11:12:17发表:

    先看一下

  2. 502316396 于 2010-11-29 11:25:48发表:

    dddddddddddddddddddddddddddddddddddddd