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

How to install freetype in php

藏色散人
Release: 2023-03-04 17:10:01
Original
5334 people have browsed it

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()
Copy after login
错误提示是指GD库中缺少freetype库,你装了GD不一定就支持freetype,很多人理解错误,
Copy after login
freetype 不是一个独立的扩展,是附着在GD库上的。
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template