How to install gd extension in php

王林
Release: 2023-03-06 20:18:02
Original
3109 people have browsed it

How to install gd extension in php: 1. Enter the php installation directory; 2. Execute the [/usr/local/php/bin/phpize] command; 3. Execute the [make && make install] command to compile and install.

How to install gd extension in php

The first step is to install dependencies

(Video tutorial recommendation: php video tutorial)

1. Install xpm

yum install libXpm-devel
Copy after login

2. Install zlib

  wget http://zlib.net/zlib-1.2.8.tar.gz
   tar -xzvf zlib-1.2.8.tar.gz
   cd zlib-1.2.8
   ./configure 
   make && make install
   make clean && make distclean
   cd ../
Copy after login

3. Install libjpeg jpeg-9b

wget http://www.ijg.org/files/jpegsrc.v9b.tar.gztar -xzvf jpegsrc.v9b.tar.gz
cd jpegsrc.v9b
./configure \--prefix=/usr/lib64 \--enable-shared \--enable-staticmake && make instll
make clean && make distclean
libtool --finish /usr/local/jpeg/lib
cd ../
Copy after login

4. Install libpng

yum install libpng libpng-devel
Copy after login

5. Install freetype2

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gztar -xzvf freetype-2.7.tar.gz
cd freetype-2.7./configure \--prefix=/usr/lib64
make && make install 
make clean && make distclean
cd ../
Copy after login

The second step is to install the gd extension

$ cd [php安装目录]
$ cd ext/gd
$ /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config --with-png-dir --with-freetype-dir --with-jpeg-dir --with-gd
$ make
$ make install
Copy after login

After the installation is successful, return to the installation location of gd:

Installing shared extensions:     /alidata/server/php-5.5.38/lib/php/extensions/no-debug-non-zts-20121212/
Copy after login

The third step is to enable gd extension

Then open /alidata/server/php-5.5.38/etc/php.ini

in

;extension=/path/to/extension/msql Add a line near .so

extension=/alidata/server/php-5.5.38/lib/php/extensions/no-debug-non-zts-20121212/ gd.so

Finally restart the php-fpm service

Related recommendations:php training

The above is the detailed content of How to install gd extension in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template