Fatal Error Call To Undefined Function Curl_init In Php
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function curl_init() in … on line 9 up vote 36 down vote favorite 8 base64_encode($data), 'key' => IMGUR_API_KEY); $timeout = 30; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://api.imgur.com/2/upload.xml'); curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars); $xml = curl_exec($curl); curl_close ($curl); var_dump($xml); ?> I'm playing with the Imgur API, but it doesn't seems to work. PHP.net says that curl_init() is in PHP5, but my host says it isn't. How can I make this work? php linux ubuntu curl debian share|improve this question edited Nov 3 '14 at 21:04 austin 4,64611835 asked Dec 9 '10 at 9:44 Thew 4,747153783 add a comment| 6 Answers 6 active oldest votes up vote 30 down vote accepted curl is an extension that needs to be installed, it's got nothing to do with the PHP version. http://www.php.net/manual/en/curl.setup.php share|improve this answer answered Dec 9 '10 at 9:46 fire 12.6k104695 +1 And if you can
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up http://stackoverflow.com/questions/4396779/fatal-error-call-to-undefined-function-curl-init-in-on-line-9 how to remove Fatal error: Call to undefined function curl_init() up vote 1 down vote favorite I am having following error on using curlas extension Fatal error: Call to undefined function curl_init() in C:\wamp\www***\index.php on line 15 I have following configuration ;extension=php_bz2.dll extension=php_curl.dll ;extension=php_dba.dll i installed wampserver2.2e-php5.4.3-httpd2.2.22-mysql5.5.24-x64.exe i tried to enable other extension also and restarted server but they local host is not able http://stackoverflow.com/questions/12593883/how-to-remove-fatal-error-call-to-undefined-function-curl-init to load that extension. php wampserver share|improve this question edited Jun 26 '13 at 11:27 Aditya P Bhatt 9,009145785 asked Sep 26 '12 at 2:46 Kasma 1,17341524 Are those extension directives really all on one line? If so, it is invalid (and commented out anyway) –Michael Berkowski Sep 26 '12 at 2:51 1 Also, be sure you are modifying the correct php.ini. Check the output of phpinfo() to see which php.ini file is being loaded, and load the extension in that one. –Michael Berkowski Sep 26 '12 at 2:52 Are you trying to load a page through a browser on your local machine, or execute a script via command-line? –newfurniturey Sep 26 '12 at 2:55 @MichaelBerkowski not in single line...it was in stackoverflow code... another thing , yes i verified all available php.ini... although i corrected ini which was refernced in phpinfo() –Kasma Sep 26 '12 at 3:18 @newfurniturey using browser on local machine.... –Kasma Sep 26 '12 at 3:19 | show 1 more comment 4 Answers 4 active oldest votes up vote 2 down vote If you're exper
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://stackoverflow.com/questions/14724661/fatal-error-call-to-undefined-function-curl-init-using-batch-file hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function curl_init() using Batch File up vote 0 down vote favorite I have a PHP that downloads files from backend. I am using WAMP in fatal error 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? php curl share|improve this question edited Feb 6 '13 at 8:38 KingCrunch fatal error call 71.1k12105139 asked Feb 6 '13 at 8:33 aandroidtest 42831545 1 Check the php.ini for your cli environment. –j0k Feb 6 '13 at 8:37 install php curl library... –Deadlock Feb 6 '13 at 8:42 add a comment| 4 Answers 4 active oldest votes up vote 3 down vote accepted uncomment the following on your php.ini ;extension=php_curl.dll and restart webserver. This might be due to curl disabled in your php. share|improve this answer answered Feb 6 '13 at 8:42 user7282 2,84232350 add a comment| up vote 2 down vote When you use wamp, xamp or other all-in-one server, it uses an overrided php.ini located into bin/conf/ instead where original is. You need copy from these or edit the ini located at php.exe folder. If you cant access it (shared server, etc), you can create a custom php.ini file into script folder, and put needed instructions: extension_dir = "c:/wamp/bin/php/php5.3.5/ext/" // change version if needed to yours extension = php_curl.dll share|improve this answer answered Jun 15 '13 at 0:30 erm3nda 761619 add a comment| up vote 0 down vote When using through browser it is using WAMP and the PHP ini is from C:\wamp\bin\php\php5.4.3 But I have set my php directory to C:\php-5.4.9 in environmental variables, thus when using windows batch it is calling php from that directory and there was no php.ini file there. I copied the PHP ini file from wamp