服务器 频道

linux/mysql/php--with-gd的安装文档

  【IT168 服务器学院】一, 所需软件:

  apache_1.3.20.tar.gz
  freetype-1.3.1.tgz
  mysql-3.23.39.tar.gz
  zlib-1.1.3.tar.gz
  gd-with_gif-1.8.3-8.i586.rpm
  gd-with_gif-1.8.3-8.src.rpm
  gd-with_gif-devel-1.8.3-8.i586.rpm
  gd-with_gif-progs-1.8.3-8.i586.rpm

  二, 安装:

  1, 在/usr/local下建一个目录soft
  mkdir /usr/local/soft

  2, 将上述所需的软件cp到/usr/local/soft

  3, 压缩包解开
  cd /usr/local/soft
  tar.gz 用 tar –zxvf 文件名 来解开
  tar –zxvf apache_1.3.20.tar.gz
  tar –zxvf mysql-3.23.39.tar.gz
  tar –zxvf zlib-1.1.3.tar.gz
  tgz的文件,先建一个目录(freetype),用tar –zxvf freetype-1.3.1.tgz freetype来解开。

  4, 安装gd的rpm包(按顺序,几个包之间有依赖关系)。
  首先要先安装gd-with_gif-1.8.3-8.i586.rpm
  rpm –i gd-with_gif-1.8.3-8.i586.rpm
  然后
  rpm –i gd-with_gif-1.8.3-8.src.rpm
  rpm –i gd-with_gif-devel-1.8.3-8.i586.rpm
  rpm –i gd-with_gif-progs-1.8.3-8.i586.rpm

  5,安装mysql
  cd mysql-3.23.39
  ./configure –prefix=/usr/local/mysql 把mysql安装到/usr/local/mysql
  make
  make install
  cd /usr/local/mysql/bin
  ./mysql_install_db
  ../share/mysql/mysql.server start
  ./mysql 运行mysql改变root用户的密码、再增加一个ggaaoo用户口令
  为123
  mysql>set password for root=password(‘root123’);
  mysql>grant all privileges
  mysql>on *.*
  mysql>to ggaaoo;
  mysql> set password for ggaaoo=password(‘123’);
  mysql>exit //退出mysql

  6, apache和php的安装
  先编译zlib,这是gd必须的一个东东
  cd /usr/local/soft/ zlib-1.1.3
  ./configure
  make
  make install

  cd /usr/local/soft/ apache_1.3.20
  ./configure –prefix=/usr/local/apache //强迫安装到/usr/local/apache目录下
  cd ../php4.0.4
  ./configure –with-mysql=/usr/local/mysql –with-apache=../apache_1.3.20 --with-gd=/usr/gd-with_gif --with-jpeg-dir=/usr/local --with-ttf=../freetype --with-zlib=/usr/local --enable-track-vars
  make
  make install
  cd ../apche_1.3.20
  ./configure --prefix=/server/apache --activate-module=src/modules/php4/libphp4.a
  make
  make install
  安装完了

  三、配置php/apache

  cd ../php4.0.4
  cp php.ini-dist /usr/local/lib/php.ini
  cd /usr/local/lib
  vi php.ini
  修改:[mysql]下
  mysql.default_port = 3306
  mysql.default_host = localhost
  mysql.default_user = root
  cd /usr/local/apche/conf
  vi httpd.conf
  修改需要的选项

  gd结果是
  gd
  GD Support Enabled
  GD Version 1.6.2 or higher
  FreeType Support Enabled
  FreeType Linkage With TTF library
  GIF Support Enabled
  JPG Support Enabled
  PNG Support Enabled
  WBMP Support Enabled
  

0
相关文章