aandroidtest aandroidtest - 2 months ago 18
PHP Question

Fatal error: Call to undefined function curl_init() using Batch File

I have a PHP that downloads files from backend. I am using WAMP in Windows 7 and it works perfectly when done through the browser.

Now I have created a batch file to execute the php and it shows:


Fatal error: Call to undefined function curl_init()


Not sure why something that could work over in browser is not working in batch file. Below is my code for the batch file:

@ECHO OFF
php.exe -f "C:\wamp\www\test\test.php"


Any idea what's the issue?

Answer

uncomment the following on your php.ini

;extension=php_curl.dll

and restart webserver. This might be due to curl disabled in your php.