Heim >Backend-Entwicklung >PHP-Tutorial >如何处理php服务器端requires ext-gd 报错?

如何处理php服务器端requires ext-gd 报错?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:13:314251Durchsuche

今天在安装Laravel Debugbar 安装包的过程中出现了requires ext-gd * -> the requested PHP extension gd is missing from your system.的错误,谷歌了下,终于找到了解决的方法。

安装报错:


解决方法:

该错误很明显,缺少GD库,所以我们需要通过命令来安装。如果你的服务器是Ubuntu,可以应用以下命令安装GD:

(if you are on a Debian based server (such as Ubuntu) you can run the following command:)

apt-get install php5-gd<br />


然后找到自己的服务器安装路径重启:

(1)Apache服务器重启

/etc/init.d/apache2 restart<br />


(2)Nginx服务器重启方式

sudo service php5-fpm restart   // 重启php<br />sudo service nginx restart      // 重启nginx<br />

This will restart your server and enable GD in PHP.


通过 phpinfo() 方法就可以查看安装信息:


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn