Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在Linux上安装GD库和freetype_Php_Linux_Ubuntu_Gd_Freetype - Fatal编程技术网

Php 在Linux上安装GD库和freetype

Php 在Linux上安装GD库和freetype,php,linux,ubuntu,gd,freetype,Php,Linux,Ubuntu,Gd,Freetype,我正在尝试使用imagefttext。我需要安装GD库和/或freetype。 我不熟悉这类东西,如何在Linux中安装GD库和freetype?安装GD: 对于CentOS/RedHat/Fedora: sudo yum install php-gd sudo apt-get install php5-gd sudo yum install freetype* sudo apt-get install freetype* sudo /etc/init.d/apache2 restart

我正在尝试使用imagefttext。我需要安装GD库和/或freetype。 我不熟悉这类东西,如何在Linux中安装GD库和freetype?

安装GD: 对于CentOS/RedHat/Fedora:

sudo yum install php-gd
sudo apt-get install php5-gd
sudo yum install freetype*
sudo apt-get install freetype*
sudo /etc/init.d/apache2 restart
对于Debian/ubuntu

sudo yum install php-gd
sudo apt-get install php5-gd
sudo yum install freetype*
sudo apt-get install freetype*
sudo /etc/init.d/apache2 restart
安装freetype: 对于CentOS/RedHat/Fedora:

sudo yum install php-gd
sudo apt-get install php5-gd
sudo yum install freetype*
sudo apt-get install freetype*
sudo /etc/init.d/apache2 restart
对于Debian/ubuntu

sudo yum install php-gd
sudo apt-get install php5-gd
sudo yum install freetype*
sudo apt-get install freetype*
sudo /etc/init.d/apache2 restart

之后不要忘记重新启动apache(如果您正在使用apache):

CentOS/RedHat/Fedora

sudo /etc/init.d/httpd restart

Debian/ubuntu

sudo yum install php-gd
sudo apt-get install php5-gd
sudo yum install freetype*
sudo apt-get install freetype*
sudo /etc/init.d/apache2 restart


事情要简单得多,除非把它们弄糊涂了

在Ubuntu中安装GD库

sudo apt-get install php5-gd
sudo apt-get install libfreetype6-dev:i386
在Ubuntu中安装Freetype

sudo apt-get install php5-gd
sudo apt-get install libfreetype6-dev:i386

对于CentOS: 安装php gd时,需要指定版本。我通过运行来修复它: sudo-yum安装php55-gd安装freetype:


sudo-apt-update&&sudo-apt-install-freetype2-demos

您正在使用哪个Linux发行版?您应该提到,不同的Linux发行版使用不同的版本,例如,Fedora/CentOS使用“Yum”,Debian/Ubuntu使用“apt”。freetype不起作用,它说无法找到包freetypeIm,而不是使用ubto来测试它,但这是我第一次搜索如何在ubunto中安装freetype。你可以搜索toowrite freetype*而不是freetype我也不知道,你应该向在存储库中添加它的人询问。据我所知,可能是以“freetype*”而不是“freetype”的名义出现的,这就是为什么我的Wordpress缩略图没有内置在14.04 LTS中,安装php5 gd也会处理freetype(因此只需要安装php5 gd)。
安装libfreetype6 dev对我来说很有用!我在aws linux上,PHP版本为5.6.17
sudo yum install php56 gd
。谢谢