0

I created my php file as .bat file using

@ECHO OFF
php -f D:\wamp\www\scrapper\scrapper5.php

I used cURL in scrapper5.php, when i run .bet file manually i got and error

call to undefined function curl_init() in your file

I researched and i got cURL is not working in CLI mode.

I just follow below step but can't get success.

Run a php script as a background process in wamp server

How can i run batch file with cURL?

Can anybody give me solution?

Community
  • 1
  • 1
Jimesh Gajera
  • 612
  • 1
  • 11
  • 32

3 Answers3

0

From the error you have posted, it looks like you do not have cURL installed. Perhaps look at you CLI config for PHP and see if the curl module is active

Bloafer
  • 1,324
  • 7
  • 12
0

Wamp may not have cURL installed by default - have a look at options for installing it on your system.

If i remember correctly, you should have a menu (right click on the wamp icon) for enabling/disabling apache modules. Have a look there for cURL and enable it. (sorry if this is a bit vague, I'm on a mac at the moment and on Windows it has been several years since I moved form WAMP to XAMPP)

If that doesn't work, some forums seem to mention downloading the cURL extension (on windows this is a .dll file) from here: http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and putting that in your ext folder under the WAMP instal directory. Just make sure to get your versions correct to ensure stability.

Husman
  • 6,819
  • 9
  • 29
  • 47
0

I think you have to enable cUrl feature in wamp server. Follow those steps may it will help you: 1. Go to wamp Server Tray icon which is placed in the task bar. 2.Open PHP Tab. 3.PHP Extensions. 4.Then make sure PHP_CURL is selected. 5.Then restart wamp server. I hope it will help you!!!!

  • 1
    I got solution, i uncomments extension=php_curl.dll from file D:\wamp\bin\apache\apache2.2.8\bin\php.ini and D:\wamp\bin\php\php5.2.6\php.ini – Jimesh Gajera Feb 18 '13 at 12:43