kontent-ai / delivery-sdk-php

Kontent.ai Delivery SDK for PHP
https://kontent.ai
MIT License
46 stars 15 forks source link

SDK timing out on sunra/php-simple-html-dom-parser #60

Closed dusekdan closed 6 years ago

dusekdan commented 6 years ago

I am working on updating Stephenr85's DG sample app to use current SDK version and I have discovered a possible issue in our SDK.

Steps to reproduce:

  1. Clone my fork
  2. Run composer update and then php artisan serve
  3. Visit locally started server (probably 127.0.0.1:8000)

The page will be loading for quite some time (approximately 2*t_max-execution_time + 1-2 seconds). After maximum execution time is reached, you will be able to see PHP Fatal error that preceeds the page finally loading: image

Simply007 commented 6 years ago

We went through the issue with @dusekdan.

It looks like, it is not a fault of the SDK itself. Maybe it is s combination with Laravel or just some application configuration fault.

Sample app is using source sample kentico cloud project (975bf280-fd91-488c-994c-2f04416e5ee3).

I have tried to run the same code the app is using for loading home page - already in the E2E test testGetHomeItem in E2E/DeliveryClientTest.php. And content is loaded without problem.

While debuging the request the simple_html_dom and simple_html_dom_node is descruted multiple times:

dusekdan commented 6 years ago

Extracting HtmlDomParser did no good.

What helped, though, was commenting out __destruct() method in simple_html_dom.php on line 140.

While this will help me to progress with updating other parts of sample site, it solves nothing and we'll have to get at the bottom of this eventually.

petrsvihlik commented 6 years ago

Shall we submit an issue to https://github.com/sunra/php-simple-html-dom-parser ?

petrsvihlik commented 6 years ago

Or a PR? :)

dusekdan commented 6 years ago

Further investigation revealed that the issue only occurs when using PHP v7.1.13. We will mention this to DG site's README and recommend not using this version of PHP.

With that, I am closing this issue.

(Relates to #13.)