Article directory
Linux CentosThe server enables GD library configuration PHP yum installation support
we do it with the websiteSEOgivePublic account promotion, If you want to improve the user experience of your website, it is best to change to a good-looking website template or WP theme.
In view of this,Chen WeiliangNo research these daysInternet marketingNow, just testing and installing a powerfulWordPressTopic, the specific requirements of the Linux server must be enabled to support the GD library.
So, I checked the Linux server with the command to make sure the GD library is installed.
Linux command to detect whether GD library is installed:
php -i | grep -i --color gd
Explain in detail what the GD library is used for
The GD library provides a series of APIs that can process images. Using the GD library allows websites to process images or generate images.
E-commerceThe server of the website usually opens the GD library to achieve the following functions:
- Used to generate thumbnails.
- Add watermark to pictures.
- Let website data generate reports.
Install GD library on Linux server
- If the GD library is not installed, please refer to the following method to install the GD library on the Linux server.
# If the source code is installed, add parameters ▼
--with-gd
# If it is a Debian-based Linux service period, use apt-get to install ▼
apt-get install php5-gd
# If it is a CentOS server, install it with yum ▼
yum install php-gd
# If it is a suse-based Linux server, install it with yast▼
yast -i php5_gd
We can add ▼ when compiling PHP originally does not support GD library
- First download the zlib source code, libpng source code, gd source code
- After decompression, go to the source directory, zlib directory
Code example ▼
./configure --prefix=/usr/local/zlib make ; make install make clean
# libpng directory ▼
cp scripts/makefile.linux ./makefile ./configure --prefix=/usr/local/libpng make ; make install make clean
# gd directory ▼
./configure --prefix=/usr/local/libgd --with-png=/usr/local/libpng make ; make install make clean
Finally, in the php.ini file, search for "gd".
Add this line below ▼
extension=/usr/local/libgdgd.so
Then, restart the php service; if that doesn't work, try reboot
Server, usually this is fine.
Please Note
However, if the GD library is installed from the source code, and only the gd library is added, the PHP version and the library version may be different.
If it is a source code installation, it is best to add the parameter –with-gd when compiling PHP
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Linux Centos Server Open GD Library Configuration PHP yum Installation Support", which is helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-563.html
Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!