Home >Backend Development >PHP Problem >How to install freetype in php

How to install freetype in php

藏色散人
藏色散人Original
2020-08-18 09:57:145355browse

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.

How to install freetype in php

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!

Statement:
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