PHP - failed to open stream: HTTP request failed!

The requests on PHP seems to be slow here for some reason. I use the same simple query on an android sdk with the same connection and connection state, I get the response faster. Why is that?

I also kept in mind that it might be the hosting server I placed the web service in, but then other web services that doesn’t involve Backendless works well. I tried the Backendless PHP sdk on another hosting server and it takes time there too.

Anywho perhaps I could bear with the slowness a little. However, sometimes if the PHP request takes a while and ends up with this exception below. This is what bothers me.

Warning: file_get_contents( failed to open stream: HTTP request failed! in /home/n00sav5/public_html/admin/asset/vendor/backendless/src/lib/HttpRequest.php on line 120Fatal error: Uncaught exception 'backendless\exception\BackendlessException' with message 'API responce ' in /home/n00sav5/public_html/admin/asset/vendor/backendless/src/lib/RequestBuilder.php:158 Stack trace: #0 /home/n00sav5/public_html/admin/asset/vendor/backendless/src/lib/RequestBuilder.php(68): backendless\lib\RequestBuilder::handleError(Object(backendless\lib\HttpRequest)) #1 /home/n00sav5/public_html/admin/asset/vendor/backendless/src/lib/RequestBuilder.php(41): backendless\lib\RequestBuilder::doRequestByUrl('https://api.bac...', NULL, 'GET') #2 /home/n00sav5/public_html/admin/asset/vendor/backendless/src/services/Persistence.php(208): backendless\lib\RequestBuilder::doRequest('data', 'Order?pageSize=...', NULL, 'GET') #3 /home/n00sav5/public_html/admin/orders.php(39): backendless\services\Persistence->find(Object(backendless\services\persistence\BackendlessDataQuery)) #4 {main} thrown in /home/n00sav5/public_html/admin/asset/vendor/backendless/src/lib/RequestBuilder.php on line 158

there is a lot of causes for this behavior.

maybe hosting where you host php is far from backendless servers. try to make requests from android and php from one place and compare response time.