我尝试将"ext-gd": "*"
添加到我的composer.json
文件(Heroku -如何在Heroku php应用程序上启用gd)
但是当我在服务器上运行composer update
时,我得到这个响应返回
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-gd * is missing from your system. Install or enable PHP's gd extension.
我该怎么做才能安装gd extension
,我试图使用laravel的社交名流库从用户的个人资料中检索头像,这就是它崩溃的地方
:
当我使用composer update --ignore-platform-reqs
它没有抛出一个错误响应,但它没有解决的问题,我仍然得到这个消息抛出当我试图检索头像图像:
GD Library extension not available with this PHP installation.
感谢所有帮助我的人
只是在composer中添加GD作为依赖项(require)不会加载扩展GD。它只是告诉这个包需要启用gd。"ext-gd"只是一个虚拟包,不存在。
你必须在你的平台上安装。
见这里composer - platform-packages
查看错误信息。它会告诉你哪里出了问题!GD库ext不可用。
这里的答案与我在你链接的帖子中的答案几乎相同:答案