CentOS:在 PHP 安装中启用 GD 支持

发布于 2024-12-29 08:04:59 字数 30 浏览 3 评论 0原文

如何在 CentOS 安装中启用 GD 支持?

How do I go about enabling GD Support in a CentOS Installation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

若无相欠,怎会相见 2025-01-05 08:04:59

最终对我有用的是:

yum install gd gd-devel php-gd

然后重新启动 apache:

service httpd restart

The thing that did the trick for me eventually was:

yum install gd gd-devel php-gd

and then restart apache:

service httpd restart
清风无影 2025-01-05 08:04:59
  1. 您需要找到一个提供与您当前 php 版本匹配的 GD 库的存储库。为此,我使用 Remi Collet 的存储库取得了巨大成功。事实上,我昨天用它来将我的 CentOS6 机器上的 php 安装更新到最新的 5.4.0RC6 版本。
  2. 设置好存储库后,运行 sudo yum install php-gd 就很简单了。
  3. 当然,通常的事情也适用:确保安装后重新启动 apache 等。
  1. You need to find a repo that offers a GD lib matching your current php version. I've had great success using Remi Collet's repo for this purpose. In fact, I used it yesterday to update my php install to the latest 5.4.0RC6 version on my CentOS6 box.
  2. Once you've setup the repo it's a simple matter of running sudo yum install php-gd
  3. Of course, the usual things apply: make sure you restart apache after installing, etc.
匿名。 2025-01-05 08:04:59

使用 CentOS 6.5+ 和 PHP 5.5:

yum install php55u-gd
service httpd restart

如果出现如下错误:cannot map Zero-fill Pages: Cannot allocate memory in Unknown on line 0,可能是因为您没有交换文件。我建议您看一下此答案中提到的教程:https://stackoverflow.com/a/20275282/828366

教程:https://www.digitalocean.com/community/articles/how-to-add-swap-on-centos-6

With CentOS 6.5+ and PHP 5.5:

yum install php55u-gd
service httpd restart

If you get an error like: cannot map zero-fill pages: Cannot allocate memory in Unknown on line 0, it could be because you don't have a swap file. I suggest you take a look at the tutorial mentioned in this answer: https://stackoverflow.com/a/20275282/828366

Tutorial: https://www.digitalocean.com/community/articles/how-to-add-swap-on-centos-6

无所的.畏惧 2025-01-05 08:04:59

CentOs 6.5+ 和PHP 5.6:

sudo yum install php56-gd

service httpd restart

CentOs 6.5+ & PHP 5.6:

sudo yum install php56-gd

service httpd restart
梦言归人 2025-01-05 08:04:59

输入命令

yum install php-gd

并重新启动服务器(httpd、nginx等)

service httpd restart

Put the command

yum install php-gd

and restart the server (httpd, nginx, etc)

service httpd restart
演出会有结束 2025-01-05 08:04:59

对于 CentOS 或 EC2 Linux AMI 上的 PHP7:

sudo yum install php70-gd

For PHP7 on CentOS or EC2 Linux AMI:

sudo yum install php70-gd
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文