您的位置:首页 > 运维架构 > Apache

Linux下apache2.2.6+php5.2.5+mysql5.0.46+Zend Optimizer 3.3.0+phpMyAdmin-2.11.1源码(二)

2015-10-28 16:53 676 查看
开始安装php
# tar -zxf php-5.0.5.tar.gz
# cd php-5.05
# ./configure --prefix=/usr/local/php --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs --with-pear=/usr/share/php --with-bz2 --with-mysql=/usr/local/mysql/--with-curl=/usr/local/curl --enable-ftp --with-libxml-dir=/usr/local/libxml2 --with-expat-dir=/usr/lib --enable-soap --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --enable-gd-native-ttf --enable-gd-jis-conv --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/lib --with-png --with-freetype-dir=/usr/local/freetype --with-config-file-path=/etc --with-iconv --disable-ipv6 --enable-static --enable-maintainer-zts --enable-zend-multibyte --enable-inline-optimization --enable-zend-multibyte --enable-sockets --enable-soap
#echo $?
# make
# make install

其中./configure 后的
--prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql/
--with-libxml-dir=/usr/local/libxml2
是必要的选项

--with-gd=/usr/local/gd2/
--with-jpeg-dir=/usr/local/jpeg6/
--with-png
--with-zlib-dir=/usr/lib
--with-freetype-dir=/usr/local/freetype
这是让PHP支持GD库的配置选项

--with-curl=/usr/local/curl 支持CURL库
--enable-ftp 打开FTP库函数支持

--enable-soap --with-xsl=/usr/local/libxslt --enable-xslt
让PHP支持SOAP, 上面这些一般用得少, 可以去掉

如果在MAKE的时候出错,那么就是你以上相关的软件没有安装好,这是最全的,出错的方法都是没有装相应的软件包,你可以查看一下。

#cp php.ini-dist /usr/local/lib/php.ini
#vi /usr/local/lib/php.ini
将register_globals = Off改为register_globals = On
●整合apache 与php
1、
#vi /usr/local/httpd/httpd.conf 些模块简单的修改
在配置文件中添加如下:
AddType application/x-httpd-php .php .php3 .php4 .php5
2、
查找:(设置 WEB 默认文件)
DirectoryIndex index.html
替换为:
DirectoryIndex index.php index.html index.htm //在 WEB 目录不到默认文件,httpd 就会执行 /var/www/error/noindex.html
3、
找到这一段:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride none

更改为AllowOverride all
允许apache rewrite

4、启动cgi
#AddHandler cgi-script .cgi 去掉#打开CGI脚本服务
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: