快捷搜索:   服务器  安全  linux 安全  MYSQL  dedecms

LAMP服务器就环境的建立(3)

  ●编译php 5.2.5

  1、freeTDS(解决PHP与MSSQL连接的问题
  具体安装如下:
freeTDS的安装
  #tar –zxvf freetds-stable.tgz
  #cd freetds-0.63
  #./configure --prefix=/usr/local/freetds #make

  #make install
  #vi /etc/ld.so.conf 设置系统动态库配置文件,加入以下:
  /usr/local/freetds/lib
  保存退出。
  #ldconfig 重新加载动态库列表ld.so.conf
  2、安装 jpeg6
  建立目录
  # mkdir /usr/local/jpeg6
  # mkdir /usr/local/jpeg6/bin
  # mkdir /usr/local/jpeg6/lib
  # mkdir /usr/local/jpeg6/include
  # mkdir /usr/local/jpeg6/man
  # mkdir /usr/local/jpeg6/man/man1
  # cd /root/soft
  # tar -zxf jpegsrc.v6b.tar.gz
  # cd jpeg-6b
  # ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
  #echo $?
  # make; make install

  3、安装libpng
  # cd /root/soft
  # tar -zxf libpng-1.2.8.tar.gz
  # cd libpng-1.2.8
  # cp scripts/makefile.std makefile
  # make; make install

  4、安装 freetype
  # cd /root/soft
  # tar -zxf freetype-2.1.10.tar.gz
  # cd freetype-2.1.10
  # ./configure --prefix=/usr/local/freetype
  #echo $?
  # make;make install

  5、安装最新的GD库
  # cd /root/soft
  # tar -zxf gd-2.0.33.tar.gz
  # cd gd-2.0.33
  # ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
  #echo $?
  # make; make install

  6、安装最新的Curl库
  # cd /root/soft
  # tar -zxf curl-7.15.0.tar.gz
  # ./configure --prefix=/usr/local/curl
  #echo $?
  # make; make install
  7、
  由于php5需libxml2的支持, 所以先安装libxml2
  # cd /root/soft
  # tar -zxf libxml2-2.6.19.tar.gz
  # cd libxml2-2.6.19
  # ./configure --prefix=/usr/local/libxml2
  #echo $?
  # make; make install

  8、安装 libxslt
  # cd /root/soft
  # tar -zxf libxslt-1.1.15.tar.gz
  # cd libxslt-1.1.15
  # ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
  #echo $?
  # make; make install
  开始安装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 --enabl e-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

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论