Server Environment CentOS
PHP version is 5.6.15, source compiled installation
Compile-time did not compile the FreeType installation, resulting in the error shown in title.
When solving this problem, go a lot of wrong way.
Now take the steps to record the solution.
1. You can use Yum to install some of the required dependent libraries
Yum-y Install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-deve L LIBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel Curl curl-devel OpenSSL Open Ssl-devel
2. Enter the PHP source directory, my directory is:/opt/source/php-5.6.15
You can do a clean action first to clear the object file (the file with the suffix ". O") and the executable that resulted from the last make command
Add --with-png-dir--with-freetype-dir--with-jpeg-dir--with-gd at compile time
My configuration parameters are as follows:
'./configure ' \
'--prefix=/usr/local/php ' \
'--with-mysql=/opt/source/mysql ' \
'--with-config-file-path=/usr/local/php/etc ' \
'--enable-soap ' \
'--enable-pdo ' \
'--with-pdo-mysql ' \
'--with-snmp ' \
'--enable-wddx ' \
'--with-openssl ' \
'--ENABLE-FPM ' \
'--with-mcrypt ' \
'--enable-mbstring ' \
'--with-curl ' \
'--with-mhash ' \
'--enable-zip ' \
'--with-pcre-regex ' \
'--enable-sysvsem ' \
'--enable-sysvshm ' \
'--enable-pcntl ' \
'--enable-mbregex ' \
'--enable-inline-optimization ' \
'--with-bz2 ' \
'--with-zlib ' \
'--enable-sockets ' \
'--with-png-dir ' \
'--with-freetype-dir ' \
'--with-jpeg-dir ' \
'--WITH-GD ' \
'--with-mysqli ' \
Not surprisingly, this will successfully configure success, generate the configuration file, and then execute make && make install
3. After the successful compilation, remember to use the compiled PHP to replace the environment variables in the PHP command (if you put your local PHP compilation environment into the environment variables, this step can be ignored)
For example, I will execute the following two commands:
cp/usr/local/php/bin/php/usr/bin/php
cp/usr/local/php/sbin/php-fpm/usr/sbin/php-fpm
Run Phpinfo () to see if a three line in the red box indicates that the installation was successful
Fatal error:call to undefined function imagettftext ()