如何在我的 Windows 服务器版本的 PHP 上安装 GD
我运行的是 Windows Server 2003,需要安装 GD 版本。
有人可以指出一些说明或建议吗?
I am running Windows Server 2003 and need to install a version of GD.
Can anyone point out some instructions or advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
检查
php_gd2.dll
是否在您的扩展目录中,并取消php.ini
的;extension=php_gd2.dll
注释。Check
php_gd2.dll
is in your extension directory and uncomment;extension=php_gd2.dll
of yourphp.ini
.它位于我的 c:\xampp\php\php.ini 中,
如您所见,它已被注释掉,删除了 ;并重新启动 apache 服务器解决了我的问题。
It was in my c:\xampp\php\php.ini
This was commented out as you can see, removing ; and restarting apache server fixed my problem.
PHP 8.0之后,GD扩展名称从php_gd2.dll更改为php_gd.dll
https://php .watch/versions/8.0/gd2-gd-windows
After PHP 8.0, GD extension name changed from php_gd2.dll to php_gd.dll
https://php.watch/versions/8.0/gd2-gd-windows
要在 PHP 8 上启用 GD 图像库,请打开 php.ini 文件,找到扩展部分并添加到其中:
extension=gd
看起来像:
[ExtensionList]
extension=gd
** 感谢本文:https://write.corbpie.com/how-to-enable-gd-library-with-xampp-php-8-on-windows/
To enable GD image library on PHP 8 open your php.ini file, find your extensions section and add into it:
extension=gd
It will looks like:
[ExtensionList]
extension=gd
** tks to this article: https://write.corbpie.com/how-to-enable-gd-library-with-xampp-php-8-on-windows/
您需要编辑 php.ini(如果您在此处安装了 PHP,则可在 C:/PHP 文件夹中找到)。添加以下行(或者删除其前面的 ; 如果存在的话):
extension=php_gd2.dll
You need to edit your php.ini (found in your C:/PHP folder if you installed PHP here). Add the following line (or remove the ; before it if it exists in there):
extension=php_gd2.dll
问题已解决。我正在使用XAPP。
我尝试在“php.ini”文件中搜索“extension=php_gd2.dll”文件,但那里没有这样的东西(“;extension=php_gd2.dll”也不存在分号)。
然后我自己在 php.ini 文件中包含了“extension=php_gd2.dll”语句。
另外,我从 https://www 下载了文件“extension=php_gd2.dll” .dll-files.com/php_gd2.dll.html 并将其放置在文件夹“C:\xampp\php”中(还有另一个文件夹 C:\xampp\php\ext,其中包含其他扩展,但无论如何这个方法不起作用)。
然后我从 xampp-control.exe 重新启动了 Apache 和 MySQL。
它不起作用。
我重置了上一步中所做的所有更改。
尝试了另一种方法:
打开“php.ini”文件(位于 C:\xampp\php)并查找“extension=gd”。
我注意到搜索的单词中有一个分号,它显示为“;extension=gd”。我删除了分号。保存 php.ini 文件。从 xampp-control.exe 停止并重新启动 Apache。
现在可以了。
那么具体解决了什么问题呢?
当我在自定义 ▸ 默认/基本设置 ▸ 站点标识中选择 WordPress 上的徽标图像时,我无法提前裁剪它。执行完第二步后,就可以了。现在我可以裁剪文件了。
Issue was resolved. I am using XAPP.
I tried to search for "extension=php_gd2.dll" file in "php.ini" file but there was no such thing there (";extension=php_gd2.dll" was also not there with a semicolon).
Then I included the statement "extension=php_gd2.dll" myself in php.ini file.
Also, I downloaded the the file "extension=php_gd2.dll" from https://www.dll-files.com/php_gd2.dll.html and placed it in folder "C:\xampp\php" (there is also another folder C:\xampp\php\ext where other extensions reside but anyway this method did not work).
Then I restarted Apache and MySQL from xampp-control.exe.
It did NOT work.
I RESET all the changes I made in the previous step.
Tried the other method:
opened "php.ini" file (at C:\xampp\php) and looked for "extension=gd".
I noticed that there was a semicolon present with the searched word and it appeared as ";extension=gd". I removed semicolon. Saved the php.ini file. Stopped and restarted Apache from xampp-control.exe.
Now it works.
So what exactly was resolved?
When I was selecting logo image on wordpress at Customizing ▸ Default/Basic Setting ▸ Site Identity, I was unable to crop it earlier. After following the second step, it works. Now I can crop files.
在php.net下载页面的Windows下载相关的调试包中,它包含了最有用的模块。之后,取消相关扩展的注释,例如 gd2:
;extension=php_gd2.dll on php.ini
并取消注释extension_dir = "ext"
。In Windows download related Debug Pack on php.net download page, it's contain most useful modules. After, uncomment related extension, for example to gd2:
;extension=php_gd2.dll on php.ini
and uncommentextension_dir = "ext"
.尽管 GD 安装在扩展文件夹中,但它对我不起作用。我的问题是 php.ini 文件引用了 extension=php_gd2.dll 而不是 extension=php_gd.dll。
GD wasn't working for me even though it was installed in the extension folder. My issue was with the php.ini file which was referenced to extension=php_gd2.dll instead of extension=php_gd.dll.