调用未定义的函数curl_init()-使用WAMP
我正在尝试使cUrl正常工作,但我感到很困惑.
I'm trying to get cUrl to work, and I'm stumped.
我没有注释php.ini
文件中的extension=php_curl.dll
,并检查了php_curl.dll
在extension_dir
指向的目录中是否存在.我还检查了Apache目录中的php.ini
是否正确.
I've uncommented extension=php_curl.dll
in the php.ini
file and checked that php_curl.dll
exists in the directory that extension_dir
points to. I've also checked that the php.ini
in the Apache directory is right.
我已将libcurl.dll
复制到Windows/System32,Windows/SysWOW64和wamp\bin\php\php5.4.3
I've copied the libcurl.dll
's to Windows/System32, Windows/SysWOW64 and wamp\bin\php\php5.4.3
我每次都重新启动服务.
And I've restarted the services every time.
我仍然得到Fatal error: Call to undefined function curl_init()
.当我运行phpInfo()
时,卷曲没有显示.但是当我查看WAMP菜单PHP-> PHP扩展php_curl
时,确实有一个选中标记.
And still I get the Fatal error: Call to undefined function curl_init()
. Curl doesn't show up when I run a phpInfo()
. But when I look in the WAMP-menu PHP->PHP extensions php_curl
does has a checkmark.
有任何提示吗?
@Daniel_M:加载的ini是Apache目录中的ini,并且extension=php_curl.dll
已取消注释,并且extension_dir
确实指向php_curl.dll
(和libcurl.dll
)所在的php/php5.4.3/ext
目录.
@Daniel_M: The loaded ini is the one in the Apache directory, and extension=php_curl.dll
has been uncommented, and extension_dir
does point to the php/php5.4.3/ext
directory where the php_curl.dll
(and libcurl.dll
) are located.
@ficuscr:我已经在各处复制了libcurl.dll v.7.27.0
.我应该放在哪里?
@ficuscr: I've copied the libcurl.dll v.7.27.0
all over the place. Where should I place it?
通常:如果在PHP > PHP Extensions menu
中未选中php_curl
,则致命错误发生在以下位置:
SCREAM: Error suppression ignored for
.选中php_curl
时不会发生这种情况.两种情况下的致命错误消息都是相同的.线索?
In general: When php_curl
is unchecked in the PHP > PHP Extensions menu
, the fatal error is preceeded by:
SCREAM: Error suppression ignored for
. This doesn't happen when php_curl
is checked. The fatal error message is the same in either case. A clue?
WAMP 2.2带有错误的cURL扩展名.您应该从以下链接下载固定文件:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/.然后将文件 php_curl.dll 替换为/php5.4.3/ext/.
WAMP 2.2 comes with a wrong cURL extension. You should download the fixed file from the following link:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/. Then replace the file php_curl.dll into /php5.4.3/ext/.