在Linux上安装GD库和freetype

C A*_* Mc 35 php linux ubuntu gd freetype

我正在尝试使用imagefttext.我需要安装GD库和/或freetype.我是这类新手的新手,如何在Linux中安装GD库和freetype?

Ali*_*lah 68

安装GD:

对于CentOS/RedHat/Fedora:

sudo yum install php-gd
Run Code Online (Sandbox Code Playgroud)

对于Debian/ubuntu:

sudo apt-get install php5-gd
Run Code Online (Sandbox Code Playgroud)

安装freetype:

对于CentOS/RedHat/Fedora:

sudo yum install freetype*
Run Code Online (Sandbox Code Playgroud)

对于Debian/ubuntu:

sudo apt-get install freetype*
Run Code Online (Sandbox Code Playgroud)

不要忘记在那之后重启apache(如果你使用的是apache):

CentOS/RedHat/Fedora:

sudo /etc/init.d/httpd restart
Run Code Online (Sandbox Code Playgroud)

要么

sudo service httpd restart
Run Code Online (Sandbox Code Playgroud)

Debian/ubuntu:

sudo /etc/init.d/apache2 restart
Run Code Online (Sandbox Code Playgroud)

要么

sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)

  • 写freetype*而不是freetype (4认同)

XIM*_*MRX 12

事情要简单得多,除非它们令人困惑.

在Ubuntu中安装GD库

sudo apt-get install php5-gd
Run Code Online (Sandbox Code Playgroud)

在Ubuntu中安装Freetype

sudo apt-get install libfreetype6-dev:i386
Run Code Online (Sandbox Code Playgroud)