dos3018
2013-02-21 07:25
浏览 122
已采纳

php无法在Windows 7 64位中加载CURL

So I've tried every solution I can find online and nothing seems to be working. I'm trying to get my first Facebook app off the ground. I'm running Apache 2.4. I installed PHP 5.4.11 manually to C:\php. I updated C:\php\php.ini changing the extension_dir to

extension_dir = "c:\php\ext"

and removing the semicolon in front of

extension=php_curl.dll

I've also added libeay32.dll and ssleay32.dll to C:\Windows, C:\Windows\System32, C:\php, C:\php\ext, C:\Apache24, and C:\Apache24\bin. All of these directories are in PATH. When I run phpinfo(), CURL is not listed there at all. I've stopped and restarted Apache after all the changes. No luck. I still get the error

Fatal error:
Uncaught exception 'Exception' with message 
'Facebook needs the CURL PHP extension.' in C:\Users\...\sdk\src\base_facebook.php:19 
Stack trace: 
#0 C:\Users\...\sdk\src\facebook.php(18): require_once() 
#1 C:\Users\...\index.php(46): require_once('C:\Users\Jew\Do...') 
#2 {main} thrown in C:\Users\...\sdk\src\base_facebook.php on line 19

EDIT #1:
Also, I'm not using WAMP server.

EDIT #2:
I added mod_ssl to httpd.conf like this: LoadModule ssl_module modules/mod_ssl.so

Now phpinfo() shows

SSL: Supported

and

OpenSSL support: disabled (install ext/openssl)

Edit #3: I just found the following errors in my Apache error.log.

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_curl.dll' - %1 is not a valid Win32 application.
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_openssl.dll' - %1 is not a valid Win32 application.
 in Unknown on line 0

Edit #4: I've tried using mod_ssl, but the apache log gives the same error as it does for loading curl. I've taken all that stuff back out.

I've also tried using both of the 5.4.13 versions of php_curl.dll from anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows as well as the original that came with PHP 5.4.11 Thread Safe version.

图片转代码服务由CSDN问答提供 功能建议

所以我尝试了我能在网上找到的所有解决方案,似乎没有任何工作。 我正试图让我的第一个Facebook应用程序开始。 我正在运行Apache 2.4。 我手动将PHP 5.4.11安装到C:\ php。 我更新了C:\ php \ php.ini,将extension_dir更改为

  extension_dir =“c:\ php \ ext”
   
  
 

并删除前面的分号

  extension = php_curl.dll 
   
 
 

我' ve还将 libeay32.dll ssleay32.dll 添加到C:\ Windows,C:\ Windows \ System32,C:\ php,C:\ php \ ext,C :\ Apache24和C:\ Apache24 \ bin。 所有这些目录都在PATH中。 当我运行phpinfo()时,根本没有列出CURL。 在所有更改后我停止并重新启动Apache。 没运气。 我仍然收到错误

 致命错误:
未捕获异常'异常',消息
'Facebook需要CURL PHP扩展。 在C:\ Users \ ... \ sdk \ src \ base_facebook.php:19 
堆栈跟踪:
#0 C:\ Users \ ... \ sdk \ src \ facebook.php(18):require_once()  
#1 C:\ Users \ ... \ index.php(46):require_once('C:\ Users \ Jew \ Do ...')
#2 {main}抛出C:\ Users \  ... \ sdk \ src \ base_facebook.php第19行
   
 
 

编辑#1:
另外,我 我没有使用WAMP服务器。

编辑#2:
我将mod_ssl添加到 httpd.conf ,如下所示:\ n LoadModule ssl_module modules / mod_ssl.so

现在 phpinfo()显示

SSL :支持

OpenSSL支持:禁用(安装ext / openssl)

编辑#3: 我刚在Apache error.log 中发现以下错误。

   PHP警告:PHP启动:无法加载动态库'c:\\ php \\ ext \\ php_curl.dll' - %1不是有效的Win32应用程序。
 
在第0行的未知
 
 
 
 
 警告:PHP启动:无法加载动态库 'c:\\ php \\ ext \\ php_openssl.dll' - %1不是有效的Win32应用程序。
 
在第0行的未知
   
 
 

编辑#4: 我尝试过使用mod_ssl,但是apache日志给出了与加载curl相同的错误。 我把所有这些东西都拿回来了。

我也尝试过使用anindya.com/的 php_curl.dll 的5.4.13版本 php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows以及PHP 5.4.11 Thread Safe版本附带的原始版本。 < / DIV>

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongwo2222 2013-02-21 08:41
    已采纳

    To sum up (if I didn't miss any detail) you have this:

    • PHP version 5.4.11, 32 bits
    • php_curl.dll version 5.4.13, 64 bits

    That cannot work. Given that you have a 64 bit machine, I suggest you also use the PHP version from anindya.com so PHP and curl match. At such site you can also find 64 bit Apache releases.

    Alternatively, use 32 bit releases of everything.

    打赏 评论
  • dongtu4028 2014-08-31 21:06

    For 64bit W7 to install 32bit PHP Curl with Apache you could try copying php_curl.dll, libeay32.dll and ssleay32.dll to C:\Windows\SysWOW64.

    打赏 评论

相关推荐 更多相似问题