yireo / Yireo_LinkPreload

Magento 2 extension to set HTTP Link headers for primary resources to allow for HTTP/2 Server Push
Open Software License 3.0
74 stars 18 forks source link

Problem with extension #18

Closed alexey-p-whidegroup closed 5 years ago

alexey-p-whidegroup commented 5 years ago

Try to install extension - and get 500 error on frontend if enable it.

Problem is in this line $crawler = new Crawler($response->getContent()); in file Plugin/ResponsePlugin.php Test in Magento 2.2.7.

Do you have any ideas??

jissereitsma commented 5 years ago

Unfortunately, no ideas yet. This works without issues for me in Magento 2.2.7 and 2.3.0. Could you elaborate? Because you mention to have a "problem" and in a specific line as well. What happens? Is there an area? Is there a dark void? What makes you say it is a problem?

alexey-p-whidegroup commented 5 years ago

So, I installed the module through the composer. The module is installed and enabled, its code is located in the vendor folder. I commented out the code that checks the value from the database so that the module always runs. And on the front - I have the 500th error. When I began to analyze the code, I saw that the error appears in the line where the new class is being created. And added the output to the browser of the test text before this line and after it. As you can see - the text is displayed before the line, and after not - because an error occurs.

alexey-p-whidegroup commented 5 years ago

File with my error - error_http2

jissereitsma commented 5 years ago

It's strange. I assume you are doing all of this in the Developer Mode, and in the Developer Mode you will never get empty 500 error messages, but you will always get a full error stack. Without the error stack, I'm as clueless as you are. So to double-check, you are indeed using version 1.0.0 and you can also find composer package symfony/dom-crawler in your vendor folder - because that package is the requirement for ServerPush and it is listed as a requirement in the composer.json.

alexey-p-whidegroup commented 5 years ago

Yes, the version of the module is: "name": "yireo / magento2-serverpush", "version": "1.0.0", Magento2 was launched both in production and in developer mode. Package symfony / dom-crawler - located in the vendor folder.

jissereitsma commented 5 years ago

I'm unable to replay this myself in any kind of environment. So unless you could provide some piece of information that leads us to the actual error, there's little I can do. Could you report the version of symfony/dom-crawler as well? And could you double-check that the 500 Internal Server Error writes this error internally somewhere? Either in the Magento logs, reports or webserver logs? Because a 500 error without any error written anymore is troublesome to say the least - there is nothing to debug, so I can be of little help, unless somebody else reports the same issue but then including the actual error.

Your editor seems to mark the word "Crawler" in yellow. Why? If there is some clue there, please report it. Because zero clues means I'm just as knowledgable as you and we would be guessing things wildly.

alexey-p-whidegroup commented 5 years ago

The problem was in the PHP version on server. Check tomorrow with another version. I''ll answer later. Thank You for Reply!

alexey-p-whidegroup commented 5 years ago

Module requires PHP 7.1.xx on server.