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

原创
2016-06-23 13:13:31 3729浏览

今天在安装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


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

(1)Apache服务器重启

/etc/init.d/apache2 restart


(2)Nginx服务器重启方式

sudo service php5-fpm restart   // 重启php
sudo service nginx restart // 重启nginx

This will restart your server and enable GD in PHP.


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


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。