在linux下配置Apache2.2.3+mysql5.0.22+php5.2.0

时间:2007-06-20 01:11:06  来源:站长资讯收集整理  作者:佚名

e.安装GD库 
 
  # tar -zvxf gd-2.0.33.tar.gz 
  # mkdir -p /usr/local/gd2 
  # cd gd-2.0.33 
  # ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ 
  --with-png=/usr/local/lib/ 
  --with-zlib=/usr/local/lib/ 
  --with-freetype=/usr/local/freetype/ 
  # make; make install 
e.安装Curl库 
  # cd /home/xiutuo/software/ 
  # tar -zxf curl-7.15.0.tar.gz 
  # mkdir -p /usr/local/curl 
  # ./configure --prefix=/usr/local/curl 
  # make; make install 

四、安装php5,php5必须有libxml2支持!
a.安装libxml2
 
  # tar -zxf libxml2-2.6.19.tar.gz
  # cd libxml2-2.6.19
  # mkdir -p /usr/local/libxml2
  # ./configure --prefix=/usr/local/libxml2
  # make; make install
b.安装 libxslt(可选安装,你可以不安装)
 
  # tar -zxf libxslt-1.1.15.tar.gz
  # mkdir -p /usr/local/libxslt
  # cd libxslt-1.1.15
  # ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
  # make; make install
c.安装php5
 
  # tar -zvxf php-5.2.0.tar.gz
  # mkdir -p /usr/local/php
  # cd php-5.2.0
  # ./configure --prefix=/usr/local/php              (注意使用续行符)
  --with-apxs2=/usr/local/apache2/bin/apxs
  --with-mysql=/usr/local/mysql (RPM方式安装,则一定不能有此项)
  --with-xml
  --with-png 
  --with-jpeg-dir=/usr/local/jpeg6 
  --with-zlib 
  --with-freetype-dir=/usr/local/freetype 
  --with-gd=/usr/local/gd 
  --with-curl 
  --enable-track-vars 
  --disable-debug 
  --enable-url-includes 
  --enable-sockets 
  --enable-force-cgi-redirect 
  --enable-calendar 
  --with-config-file-path=/etc 
  --enable-magic-quotes 
  --enable-ftp 
  --enable-gd-native-ttf 
  --with-ttf 
  --with-gdbm 
  --with-gettext 
  --with-iconv 
  --enable-mbstring=all 
  --enable-memory-limit 
  --with-xsl=/usr/local/libxslt 
  --enable-xslt
  # make
  # make install
  # cp php.ini-dist /usr/local/php/lib/php.ini 
其中./configure 后的
  --prefix=/usr/local/php
  --with-apxs2=/usr/local/apache2/bin/apxs
  --with-mysql=/usr/local/mysql(RPM方式安装,则一定不能有此项,可以使用--with-mysql的方式)
  --with-xml
是必要的选项
  --with-png 
  --with-jpeg-dir=/usr/local/jpeg6 
  --with-gd=/usr/local/gd 
  --with-zlib 
  --with-freetype-dir=/usr/local/freetype 
这是让PHP支持GD库的配置选项
后面都是一些 要使用的PHP 函数库 可以根据自己的喜好删除或增加
五、编辑apache配置文件httpd.conf
  # vi /etc/httpd/httpd.conf
  要改的有如下几处:
  找到LoadModule php5_module modules/libphp5.so
  前面的#号去掉
  #AddType application/x-gzip .gz .tgz
  下加二行
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
  还有找到DirectoryIndex index.html 
  加上 index.php 让它把index.php做为默认页
 
六、测试PHP
  # vi /var/www/index.php(其中/var/www为网页主目录)
  添加:
   <?
    phpinfo();
   ?>
  重新启动apache服务器
  # /usr/local/apache/bin/apachectl restart
  浏览器里http://127.0.0.1测试一下
七、安装ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
  # ./install.sh

文章评论

共有 位CH网友发表了评论 查看完整内容