0

(I'm running Apache 2.2 and PHP 5.4.14)

I'm having problems enabling cURL with PHP. I uncommented the extension=php_curl.dll line in php.ini and made sure that the dependencies libeay32.dll and ssleay32.dll exist in the path. I also restarted Apache. However, when I run phpinfo() I do not see a cURL header and trying to call a cURL function results in the following error: Fatal error: Call to undefined function curl_init() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\boxproject\php\lib\Box_Rest_Client.php on line 114

Does anyone see any problems with this process? Are there more ways to troubleshoot the problem? Thanks a lot for the help.

user2066880
  • 4,825
  • 9
  • 38
  • 64
  • sure you're modifying the correct php.ini? there's usually two: one for command line and one for SAPI (web-server). – Marc B May 06 '13 at 17:06
  • Yep, double checked after I saw your comment and I'm 99% sure I modified the right file. There's only one php.ini file in my installation path. – user2066880 May 06 '13 at 17:14
  • Did you check the apache log file? ( "wamp/logs/apache_error.log" if your install has been made with wamp). – antoox May 06 '13 at 17:25
  • I installed Apache and PHP individually but here is the log: `[Mon May 06 10:36:06 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function curl_init() in C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\htdocs\\boxproject\\get_access_token.php on line 16` – user2066880 May 06 '13 at 17:37
  • No message (in the logs and linked to curl) is displayed while Apache is restarting? – antoox May 06 '13 at 17:42
  • Ahh. I overlooked the messages that displayed when Apache was restarting. I get the following line during restart: `PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\Users\\jauhar.basrai\\My Programs\\php\\ext\\php_curl.dll' - The specified module could not be found.\r\n in Unknown on line 0`. I'm not sure why this error would show though, I see the php_curl.dll file in php\ext. Looks like we're on to something though, thanks a lot for the help so far!! – user2066880 May 06 '13 at 17:53
  • You need to download a php_curl.dll which has been compiled on the same OS as you and for the php 5.4.14. – antoox May 06 '13 at 17:57
  • Hm. I've downloaded php5.4.14's php_curl.dll from several sources now, but using those still doesn't fix the problem. I'm not sure that the problem is with the dll file itself. – user2066880 May 06 '13 at 18:30

1 Answers1

0

Step1: Uncomment the php_curl.dll from php.ini

Step2: Copy the following three files from php installed directory to the bin directory of Apache

libeay32.dll, libssh2.dll, ssleay32.dll

Step3: Restart apache.