Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
518 views
in Technique[技术] by (71.8m points)

php - Call to undefined function curl_init() - with WAMP

I'm trying to get cUrl to work, and I'm stumped.

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.

I've copied the libcurl.dll's to Windows/System32, Windows/SysWOW64 and wampinphpphp5.4.3

And I've restarted the services every time.

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.

Any hints?

Edit:

@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: I've copied the libcurl.dll v.7.27.0 all over the place. Where should I place it?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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/.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...