PHP Version: php-7.2.0 Linux operating system: CentOS7
This problem is encountered when compiling and installing Zabbix monitoring systems
Reminder: When compiling and installing PHP, do not compile and install the GD library, if you have compiled and installed to remove--WITH-GD to recompile the installation (try to install the GD library many times is not successful), and then go to the following steps.
1. Enter the downloaded source package php-7.2.0/ext/gd directory to execute the following command
#/usr/local/data/php/bin/phpize #/usr/local/data/php is a previously installed PHP directory
2. Compile and install JPEG and DG Extensions
#./configure--with-php-config=/usr/local/data/php/bin/php-config--with-png-dir--with-freetype-dir-- With-jpeg-dir--with-zlib-dir--WITH-GD
#make
#make Install
Successful installation prompts: Installing Shared extensions:/usr/local/data/php/lib/php/extensions/no-debug-non-zts-20170718/
3. #cd/usr/local/data/php/lib/php/extensions/no-debug-non-zts-20170718/
Access to the directory to see the extension: gd.so extension has been compiled successfully
4. Add the compiled extensions to the php.ini file
#vim/usr/local/data/php/lib/php.ini
Extension_dir= "/usr/local/data/php/lib/php/extensions/no-debug-non-zts-20170718"//Set extension path
extension=gd.so//Add GD extension 5. When you are done, restart PHP. (If you want to reinstall the above steps, be sure to execute the make clean command in the source package GD directory)