免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1300 | 回复: 0
打印 上一主题 下一主题

我自己总结的apache+php+Zend编译安装 centos [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-29 16:17 |只看该作者 |倒序浏览

1,首先先卸载软件包 《卸载系统默认的httpd,php》
使用rpm -qa|grep 软件包名  从下往上卸载  rpm -e 包名 一级一级的找。。
2,下载以下软件包
   wget http://downloads.serveropt.com/linux/httpd-2.2.6.tar.bz2
   wget http://cn2.php.net/get/php-5.2.4.tar.bz2/from/this/mirror
   wget http://downloads.serveropt.com/linux/gd-2.0.34.tar.bz2
   wget http://downloads.serveropt.com/linux/libxml2-2.6.30.tar.gz
   wget http://downloads.serveropt.com/linux/openssl-0.9.8e.tar.gz
   wget http://downloads.serveropt.com/linux/libmcrypt-2.5.8.tar.bz2
   wget http://downloads.serveropt.com/linux/ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz
3,解压软件包
  Tar.gz结尾的软件包用 tar xzvf来解压
   tar xjvf httpd-2.2.6.tar.bz2
   tar xjvf php-5.2.4.tar.bz2
   tar xjvf gd-2.0.34.tar.bz2
   tar xjvf libxml2-2.6.30.tar.gz
   tar xzvf openssl-0.9.8e.tar.gz
   tar xjvf libmcrypt-2.5.8.tar.bz2
   tar xzvf ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz
4,升级linux系统 《更新》
   Yum update
5,编译安装软件包 《顺序安装》
  (1)安装apache :
       [root@localhost ~]# cd httpd-2.2.6
       [root@localhost httpd-2.2.6]#  ./configure "--prefix=/usr/local/apache2"  "--with-included-apr"         "--enable-so"         "--enable-deflate=shared"         "--enable-expires=shared"         "--enable-rewrite=shared"         "--enable-static-support"         "--disable-userdir"
       [root@localhost httpd-2.2.6]#make
       [root@localhost httpd-2.2.6]#make install
       [root@localhost httpd-2.2.6]#echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local 写入启动项
       [root@localhost httpd-2.2.6]#/usr/local/apache2/bin/apachectl -t      测试apache正常
       [root@localhost httpd-2.2.6]#/usr/local/apache2/bin/apachectl restart     启动apache   
       [root@localhost httpd-2.2.6]#/usr/local/apache2/bin/apachectl stop       停止apache
  (2)安装php相关软件包《gd,libxml2,openssl,libmcrypt》:
   ①  [root@localhost ~]#cd gd-2.0.34
       [root@localhost gd-2.0.34]# ./configure --prefix=/usr/local/gd2
       [root@localhost gd-2.0.34]#make
       [root@localhost gd-2.0.34]#make install
       [root@localhost gd-2.0.34]#cd ..
   ②  [root@localhost ~]#cd libxml2-2.6.30
       [root@localhost libxml2-2.6.30]#./configure --prefix=/usr/local/libxml2
       [root@localhost libxml2-2.6.30]#.make
       [root@localhost libxml2-2.6.30]#.make install
       [root@localhost libxml2-2.6.30]#.cd ..
   ③  [root@localhost ~]#cd openssl-0.9.8e
       [root@localhost openssl-0.9.8e]#./config --prefix=/usr/local/openssl
       [root@localhost openssl-0.9.8e]#make
       [root@localhost openssl-0.9.8e]#make install
       [root@localhost openssl-0.9.8e]#cd ..
   ④  [root@localhost ~]#cd libmcrypt-2.5.8
       [root@localhost libmcrypt-2.5.8]#./configure --prefix=/usr/local/libmcrypt
       [root@localhost libmcrypt-2.5.8]#make
       [root@localhost libmcrypt-2.5.8]#make install
       [root@localhost libmcrypt-2.5.8]#cd ..
  (3)安装php软件包:
       [root@localhost ~]#cd php-5.2.4
       [root@localhost php-5.2.4]#./configure "--prefix=/usr/local/php"         "--with-apxs2=/usr/local/apache2/bin/apxs"         "--with-config-file-path=/usr/local/php/etc"         "--with-mysql=/usr/local/mysql"         "--with-libxml-dir=/usr/local/libxml2"         "--with-gd=/usr/local/gd2"         "--with-jpeg-dir"         "--with-png-dir"         "--with-bz2"         "--with-freetype-dir"         "--with-iconv-dir"         "--with-zlib-dir "         "--with-openssl=/usr/local/openssl"         "--with-mcrypt=/usr/local/libmcrypt"         "--enable-soap"         "--enable-gd-native-ttf"         "--enable-ftp"         "--enable-mbstring"         "--enable-exif"         "--disable-ipv6"         "--disable-cgi"         "--disable-cli"
       [root@localhost php-5.2.4]#make        php测试页info.php:内容如下
       [root@localhost php-5.2.4]#make install                             phpinfo();
       [root@localhost php-5.2.4]#cd ..                                    ?>
  
  (4)修改http.conf配置文件
        第105行  修改为/var/www 访问apache的目录
        第167行  加index.htm  index.php
        第273行下面添加   
                        
                            AllowOverride None
                            Options None
                            Order allow,deny
                            Allow from all
                        
        第310行添加一句:AddType application/x-httpd-php .php
        修改vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
            删除27行后面的所有东西  影响apache的启动
   (5)安装Zend :
      1, 首先先把php软件包中的php.ini-dist 复制到 /usr/local/php/etc/php.ini (改名后)
       [root@localhost ~]#cd php-5.2.4
          在 /usr/local/php下是没有etc这个目录  所以需手工创建
       [root@localhost php-5.2.4]#mkdir /usr/local/php/etc
       [root@localhost php-5.2.4]#cp php.ini-dist /usr/local/php/etc/php.ini   zend安装需要这个文件
       [root@localhost php-5.2.4]#cd ..
      2,安装zend软件包
       [root@localhost ~]#cd ZendOptimizer-3.3.0-linux-glibc21-i386
       [root@localhost ZendOptimizer-3.3.0-linux-glibc21-i386]#   ./install.sh
       在安装时显示到php.ini的对话框的时候  要把路径改为/usr/local/php/etc
       下一步就行了  安装完会自动重起apache 。。。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/55459/showart_432856.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP