0

I'm trying to analyze data from the Wikidata API, but I keep getting timed out when running the var_dump function. Please see my code below:

<html>
<body>
<h2>Search</h2>
<form method="post">
Search: <input type="text" name="q" value="Google"/>
<input type="submit" value="Submit">
</form>

<?php
if (isset($_POST['q'])) {
$search = $_POST['q'];

$url_2 = "http://www.wikidata.org/w/api.php?
action=wbgetentities&sites=enwiki&titles=$search&languages=en";
$res_2 = file_get_contents($url_2);
$data_2 = json_decode($res_2);
var_dump($data_2);

}
exit;

?>

</body>
</html>

I click Submit however get: Fatal error: Maximum execution time of 30 seconds exceeded in... Any other suggestions to analyze the data? Thanks.

Termininja
  • 6,620
  • 12
  • 48
  • 49
Oroku
  • 443
  • 1
  • 3
  • 15
  • If you know that it is `var_dump` that is timing out, have you tried replacing it with e.g. something like `echo('
    ');
    print_r($data_2);
    echo('
    ');`?
    – leo Dec 15 '14 at 09:02
  • Hi @leo not tried that - thanks I'll do so – Oroku Dec 15 '14 at 09:05

0 Answers0