(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:内容如下 <?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行下面添加
<Directory "/var/www">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
第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 。。。