0

I have just downloaded the latest xampp and it is my first time to use curl. I have an account in appannie and have read one of the posts here regarding his/her attempt to access appannie.

Here is the link of that post: Appannie api basic authentication

Well, to make it simpler here is that code he made:

<?php

$whmusername = "username";
$whmpassword = "password";

$query = "https://api.appannie.com/v1/accounts";

$ch = curl_init();
// Sets the URL cURL will open
curl_setopt($ch, CURLOPT_URL, $query);
// Here's the HTTP auth
// The 3rd argument is your Twitter username and password joined with a colon
curl_setopt($ch, CURLOPT_USERPWD, $whmusername.":".$whmpassword);
// Makes curl_exec() return server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// And here's the result XML
$response = curl_exec($ch);
curl_close($ch);

// inserted: echo 'hello';
print $response;
// inserted: echo 'world';
?>

I tried to use that but nothing happened. So i inserted echo (which i have labeled in the comment) both before and after response to see if my php network is really working and it just displayed:

hello world

So i was wondering if curl library in xampp and have read this post: curl not working in xampp localhost

In the comments were the steps but what i found out was the curl in php.ini in php dir is already not in comment form and there was no php.ini in apache dir.

And i the 1st post that i referred regarding appannie, i have already change the username into the email account used in appannie.

Please any help? Thanks

Community
  • 1
  • 1
Mika Sa
  • 143
  • 3
  • 13

1 Answers1

0

There are three different php.ini files that require modification for the cURL library to work on XAMPP.

  1. C:\Program Files\xampp\apache\bin\php.ini
  2. C:\Program Files\xampp\php\php.ini
  3. C:\Program Files\xampp\php\php4\php.ini

You need to uncomment (if not already) the line for cURL Extension:

  ;extension=php_curl.dll
  ^----- remove semi-colon

Once you've made the change, you'll need to restart XAMPP.

Also, make sure that there are two files in your Windows system32 folder: libeay32.dll and ssleay32.dll. If these files are missing, you can copy them over from the PHP folder.

Hope this helps!

Amal Murali
  • 75,622
  • 18
  • 128
  • 150