1

I am trying to make use of RESTful service using php. I am able to get the JSON format output wen i run the php file through terminal. But if I try running it using apache webserver i am getting a blank web page. please help me.

<?php
$client=curl_init("http://wwwdev.ebi.ac.uk/pdbe/api/emdb/entry/map/EMD-1200");
        curl_setopt($client,CURLOPT_RETURNTRANSFER,1);

        //get response from resource

        $response=curl_exec($client);

    echo $response;
        //decode
      //  $res=array(json_decode($response));
       // echo $res;

?>

This is my code.

user1537757
  • 9
  • 2
  • 6

1 Answers1

0

Run

phpinfo();

and make sure you have curl enabled!

enter image description here

If not then uncomment this line from php.ini.

;extension=php_curl.dll

Then restart your server.

Shreejibawa
  • 1,860
  • 1
  • 25
  • 35