How to install freetype in php: First execute the command "make && make install" to install freeType; then install GD including freetype; then switch to the PHP ext source code directory; and finally restart the php service.
Recommended: "PHP Video Tutorial"
PHP Fatal error: Call to undefined function imagettftext()
错误提示是指GD库中缺少freetype库,你装了GD不一定就支持freetype,很多人理解错误,
freetype 不是一个独立的扩展,是附着在GD库上的。
freeType official download address: https:// www.freetype.org/download.html
The first step is to install freeType
./configure --prefix=/usr/local/freetype make && make install
The second step is to install GD including freetype
Switch to the PHP ext source code directory
/opt/php5/bin/phpize ./configure --with-php-config=/opt/php5/bin/php-config --with-jpeg-dir=/usr/local/jpeg/lib --with-freetype-dir=/usr/local/freetype --enable-gd-native-ttf make && make install
If you need to install gd to support jpeg, please see https://blog.csdn.net/coolpan123/article/details/72916802
If you have not installed gd, write gd.so into php.ini
If you have installed gd before, just restart the php service directly
The above is the detailed content of How to install freetype in php. For more information, please follow other related articles on the PHP Chinese website!