简体   繁体   English

PHP中的GD2库未安装

[英]GD2 library in PHP not installing

I'm having problems installing the GD library. 我在安装GD库时遇到问题。 I'm using an IIS server with PHP 5.2.14. 我正在使用IIS服务器和PHP 5.2.14。 I uncommented extension=php_gd2.dll in php.ini. 我在php.ini中取消注释extension=php_gd2.dll

This is the error: 这是错误:

gd: Unable to initialize module
Module compiled with module API =20060613
PHP compiled with modlule API = 20090626
These options need to match
  in Unknown on Line 0

I downloaded various PHP versions to try and get the correct DLL, including thread-safe 5.2.14. 我下载了各种PHP版本以尝试获取正确的DLL,包括线程安全的5.2.14。 I would then restart my application pool and try to load a file that uses the GD library. 然后,我将重新启动应用程序池,并尝试加载使用GD库的文件。 Are there other files necessary for gd2 to work? gd2是否需要其他文件才能工作? Are there any quick ways to solve this without reinstalling PHP entirely? 有什么快速方法可以解决此问题,而无需完全重新安装PHP?

first, iis7 was not configured properly for php - I searched for a guide that walked me through. 首先,iis7没有针对php进行正确配置-我搜索了一个指导我的指南。 Second the directory was incorrect, whenever I reset the iis server it originally would say one directory when ISAPI api was being used- but after 2 mins it would say extension_dir was in another directory when cgi/fastcgi is being used. 第二个目录是不正确的,每当我重置iis服务器时,它最初都会在使用ISAPI api时说一个目录-但是2分钟后,在使用cgi / fastcgi时它会说extension_dir在另一个目录中。 So i created that directory that it wanted (which was different than any of my php.ini's). 因此,我创建了它想要的目录(这与我的任何php.ini都不同)。 The one it was pulling from needed to be put in the C:/windows directory, but even though I had it set to go to "./ext" it wanted to go to Program files/PHP-- extremely weird. 它从中拉出的那个文件需要放在C:/ windows目录中,但是即使我将其设置为“ ./ext”,它也想转到程序文件/ PHP,这很奇怪。 Third, I had to add IUSR to the permissions of any folder being used. 第三,我必须将IUSR添加到正在使用的任何文件夹的权限中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM