Home > Backend Development > PHP Tutorial > Add gd extension to php under centos

Add gd extension to php under centos

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:58:48
Original
2031 people have browsed it

Step 1:

Install the required libraries

yum -y install libjpeglibjpeg-devel libpng libpng-devel freetype freetype-devel

Step 2:

Enter the ext/gd directory under the source code directory of PHP (This is the source code directory, not the installation directory, please pay attention to the difference)

1. First execute: {$php_indtall_dir}/bin/phpize

Note: {$php_indtall_dir} here refers to the installation directory of php. If it is installed to / usr/local/php, then execute /usr/local/php/bin/phpize, here is where the .configure compiled file is generated

2. Execute: ./configure --with-png-dir --with-freetype -dir --with-jpeg-dir --with-gd --with-php-c/local/php/bin/php-config

Note: The --with-php-config directory here is based on your own PHP installation Path configuration

3. Execute: make && make install

Step 3: Modify php.ini

Add: extension=gd.so

Step 4:

Restart php-rpm, and then restart nginx or apache, here you can see that the php_info page has a gd extension^_^

Without this library, the verification of your website cannot be displayed!

The above introduces the gd extension for php under centos, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template