首页  >  文章  >  后端开发  >  linux下php gd 库的安装步骤

linux下php gd 库的安装步骤

WBOY
WBOY原创
2016-07-25 08:55:11995浏览
  1. tar xzvf zlib-1.2.3.tar.gz
  2. cd zlib-1.2.3
  3. ./configure
  4. make
  5. make install
复制代码

2、安装freetype

  1. tar xzvf freetype-2.2.1.tar.gz
  2. cd freetype-2.2.1
  3. ./configure
  4. make
  5. make install
复制代码

3、安装libpng

  1. tar xzvf libpng-1.2.12.tar.gz
  2. cd libpng-1.2.12
  3. cp scripts/makefile.std makefile
  4. make test
  5. make install
复制代码

4、安装jpeg 建立文件包:/usr/local/man/man1

  1. tar xzvf jpegsrc.v6b.tar.gz
  2. ./configure --enable-shared --enable-static
  3. make
  4. make install
复制代码

注意,如果安装PHP5,必需安装libxml2

5、安装GD库

  1. tar xzvf gd-2.0.18.tar.gz
  2. ./configure --with-jpeg --with-png --with-zlib --with-freetype
  3. make
  4. make install
复制代码

二,更改apache的配置文件: 让apache能解释php程序。 1,查找AddType application/x-tar .tgz 行,在下面添加:

  1. AddType application/x-httpd-php .php
  2. AddType application/x-httpd-php .php3
  3. AddType application/x-httpd-php .phtml
  4. AddType application/x-httpd-php-source .phps
复制代码

2,找到下面一行在后面添加:index.php,表示网站的默认页也允许为index.php

  1. DirectoryIndex index.html index.html.var index.php
复制代码


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn