Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dusekdan opened this issue May 30, 2018 · 5 comments
Closed

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

dusekdan opened this issue May 30, 2018 · 5 comments
Assignees
Labels

Comments

@dusekdan
Copy link
Contributor

dusekdan commented May 30, 2018

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
Copy link
Contributor

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:

  • __destruct().
    So @dusekdan tries to extract HtmlDomParser instantiation to the property and use this one instance instead of instantiation the parser all the time, if it helps.

@dusekdan
Copy link
Contributor Author

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
Copy link
Contributor

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

@petrsvihlik
Copy link
Contributor

Or a PR? :)

@dusekdan
Copy link
Contributor Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants