tags:

views:

171

answers:

2

Hi

I have have problem while using the cURL in my php script.

Wheni used it its given me below error.

Fatal error: Call to undefined function curl_init()

This problem is for both local and live url .

But when i move my code to live its working fine.

I have contact n/w admin but its say that there is no such restriction in firewall.

I am not getting the problem.

Thanks

Avinash

+1  A: 

You might want to ask the server support team whether curl extension is enabled on their server or not. It may be that it is enabled on your local server but not online.

Sarfraz
the problem is when i am accessing the live url from local, in live its working fine...
Avinash
oh, then it might be something on the end of online server settings possibly.
Sarfraz
i have just edited my code, can u pl check it again?
Avinash
because you are getting the underfine function error, this most likely means that the extension is disabled where you are running the script.
Sarfraz
+1  A: 

It sounds like your code is working when you move it to a production environment, but it's not working in your development environment. It's not a problem with your code... it sounds like cURL is not installed in your dev environment.

cURL is a library that you'll need to specifically install in order to use. If your local environment is a linux machine, you need the php5-curl package installed.

If your local environment is a Windows machine, you can re-run the PHP installer to add it. Choose Change, and then at the "Choose Items" screen, expand the Extensions and choose "Will be installed on local hard drive" from next to the Curl option (see image).

alt text

Make sure that cURL extension is also enabled in your php.ini file after it's been installed.

zombat
i have manually install it.Can u pl explain how can i manually install curl in my local machine?
Avinash
You'd have to tell me what kind of set up you're using. Of course, it'd probably be faster for you to just Google it.
zombat
yes i have done it myself.. thanks
Avinash