0

I am trying to implement Wolfram Alpha API to my application. I download their language library and load their sample page in my browser.

However, I got

Warning: simplexml_load_file(http://api.wolframalpha.com/v1/query.jsp?appid=myid-8RJR4ELL82&input=pi): failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\wolfram\PHP_Binding_0_1\wa_wrapper\WolframAlphaEngine.php on line 47

Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://api.wolframalpha.com/v1/query.jsp?appid=myid-8RJR4ELL82&input=pi" in C:\xampp\htdocs\wolfram\PHP_Binding_0_1\wa_wrapper\WolframAlphaEngine.php on line 47

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wolfram\PHP_Binding_0_1\wa_wrapper\WolframAlphaEngine.php on line 47

I use their premade PHP library and load

http://localhost/wolfram/PHP_Binding_0_1/samples/simpleRequest.php?q=pi

in my address bar.

Can anyone help me about this issue? Thanks a lot!

Rouge
  • 4,181
  • 9
  • 28
  • 36

1 Answers1

1

Maximum execution time of 30 seconds exceeded

Set the request timeout to a number greater than 30 seconds or get a better internet connection.

You can do this by the following:

set_time_limit

set_time_limit(120); // two minutes

or if you are using a CURL request:

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);

Alternatively, call up your internet provider and ask to upgrade your data plan to a higher number of mb/s.

It would also help to post you code. The mentioned methods of fixing this are based on the error, which could be resultant of a separate problem.

max_
  • 24,076
  • 39
  • 122
  • 211