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

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.

  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝