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

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

WBOY
Release: 2016-06-23 13:13:31
Original
4220 people have browsed it

今天在安装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 />
Copy after login


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

(1)Apache服务器重启

/etc/init.d/apache2 restart<br />
Copy after login


(2)Nginx服务器重启方式

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

This will restart your server and enable GD in PHP.


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


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template