欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

linux下php gd 库的安装步骤

程序员文章站 2022-04-30 17:38:54
...
  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
复制代码