Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function curl_init() error

Tags:

php

php-curl

I am on a Win 64 bit OS, php 5.6.8 using Eclipse PDT to develop PHP.

I have come across this Call to undefined function curl_init() error.

I removed the ; preceeding extension=php_curl.dll in php.ini .Restarted the Apache server but still getting the same error.

Any hint where I am going wrong?

like image 543
saurav Avatar asked Apr 24 '15 04:04

saurav


4 Answers

I had the same issue and after hours, I found a message here :

http://php.net/manual/curl.installation.php

which says, "Upgrading to php 5.6.9 on Windows 7 x64 cURL no longer is recognized. No errors on server start package just not available and didn't show in phpinfo.php. deplister.exe was ok I fixed coping the following list files from php folder (in my case D:\xampp\php) libeay32.dll, libssh2.dll, ssleay32.dll to c:\xampp\apache\bin (or your apache\bin path), restart Apache and works fine, Apache's libraries were outdated."

It worked for me.

Not easy to find, right ? :-)

like image 122
nico Avatar answered Oct 04 '22 02:10

nico


Your issue is probably already solved. But for those still searching, please find my answer here.

It might be the the wrong Path being pointed at.

My answer in the Link ( Call to undefined function curl_init() even it is enabled in php7 ) says:

Your Filepath is probably incorrect

Check the Apache error log in

/var/log/apache2/error.log

if the called path or filename does match your real path in e.g.

/usr/lib/php/20151012/php_curl.so

In my case it's been the same path, but "the php_" was missing

/usr/lib/php/20151012/curl.so

So I changed the path / filename accordingly in

/etc/php/7.0/cli/conf.d/20-curl.ini 

from

extension=php_curl.so

into

extension=curl.so
like image 40
leopold Avatar answered Oct 04 '22 03:10

leopold


Just add php folder path in PATH environment variable..... ;)

like image 31
Vipin Jain Avatar answered Oct 04 '22 03:10

Vipin Jain


Have 2 steps:

  1. Go to php.ini and remove ; in line ;extension=curl (in window). With Linux you can find curl to un-comment it.
  2. I download internet 3 files: libeay32.dll, libssh2.dll, ssleay32.dll. And past to {Apache Folder}/bin. Then restart apache.

You can refer this link if need https://www.php.net/manual/en/curl.installation.php

It is OK now.

like image 21
Tien Nguyen Avatar answered Oct 04 '22 04:10

Tien Nguyen