我想使用imagefttext,并且需要安装GD库和/或Freetype。
我对这种东西很新,在Linux上如何安装GD库和Freetype?
对于 CentOS / RedHat / Fedora 操作系统 :
sudo yum install php-gd
对于 Debian/ubuntu 操作系统:
sudo apt-get install php5-gd
对于CentOS / RedHat / Fedora:
sudo yum install freetype*
对于 Debian/Ubuntu:
sudo apt-get install freetype*
不要忘记在完成操作后重新启动 Apache(如果您正在使用 Apache):
CentOS / RedHat / Fedora:
sudo /etc/init.d/httpd restart
或者
sudo service httpd restart
Debian/Ubuntu:
sudo /etc/init.d/apache2 restart
或者
sudo service apache2 restart
事情本来很简单,除非它们被搞得混淆不清。
在Ubuntu中安装GD库
sudo apt-get install php5-gd
在Ubuntu中安装Freetype
sudo apt-get install libfreetype6-dev:i386
apt-get install libfreetype6-dev
对我有用! - ch271828n对于CentOS: 在安装php-gd时,您需要指定版本。我通过运行以下命令来解决这个问题: sudo yum install php55-gd