在linux下设置php效劳器Apache2.2.3 mysql5.0.22 php5.2.0(2)

  来源:网海拾贝





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





版权声明: 原创作品,答应转载,转载时请务必以超链接体式格局标明文章 原始情由 、作者信息和本声明。否则将清查法律责任。

posted @ 2011-03-07 20:37  蓝色的天空III  阅读(153)  评论(0编辑  收藏  举报