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条)

报告相同问题?

悬赏问题

  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害