Linux下如何安装http+php+zend

来源:爱站网时间:2020-11-24编辑:网友分享
是不是有很多用户们对于Linux下安装http+php+zend的步骤不了解呢?Linux下如何安装http+php+zend?接下来我们就带着这个疑问一起去看看下文内容吧。

是不是有很多用户们对于Linux下安装http+php+zend的步骤不了解呢?Linux下如何安装http+php+zend?接下来我们就带着这个疑问一起去看看下文内容吧。

Linux下安装http+php+zend步骤:

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

linux

(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 ..

linux

(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 。。。

以上就是Linux下如何安装http+php+zend的内容,如果你想了解更深一点的可以进入爱站技术频道进行了解哦。

上一篇:Ubuntu7.10下安装配置Tomcat的教程

下一篇:Linux常用的FTP服务器有哪些

您可能感兴趣的文章

相关阅读

热门软件源码

最新软件源码下载