Genaker / Magento2OPcacheGUI

Magento 2 Opcache Control GUI using React Frontend Micro-services.
MIT License
55 stars 15 forks source link

Error include_path adminhtml/templates/index/gui.phtml #2

Closed Garde85 closed 3 years ago

Garde85 commented 3 years ago

Error include_path adminhtml/templates/index/gui.phtml

Issue Description

Preconditions

1. Magento Open source 2.3.5-p2.
2. genaker/module-opcache

Steps to reproduce

1. Deploy magento production mode
2. Access to magento admin panel
3. Go to System > React > Opcache Gui

Expected result:

Opcache gui page showing opcache configurations https://github.com/Genaker/Magento2OPcacheGUI#magento-2-opcache-gui

Actual result:

Missing opache gui informations:

image

Additional information

In my error log i find this error:

[24-Dec-2020 09:39:54 UTC] PHP Fatal error:  Magento\Framework\View\Result\Page::main(): Failed opening required '/var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/var/www/myhost/htdocs/vendor/genaker/module-opcache/vendor/amnuts/opcache-gui/index.php' (include_path='/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml on line 1
[24-Dec-2020 09:39:54 UTC] PHP Stack trace:
[24-Dec-2020 09:39:54 UTC] PHP   1. {main}() /var/www/myhost/htdocs/pub/index.php:0
[24-Dec-2020 09:39:54 UTC] PHP   2. Magento\Framework\App\Bootstrap->run() /var/www/myhost/htdocs/pub/index.php:45
[24-Dec-2020 09:39:54 UTC] PHP   3. Magento\Framework\App\Http->launch() /var/www/myhost/htdocs/vendor/magento/framework/App/Bootstrap.php:261
[24-Dec-2020 09:39:54 UTC] PHP   4. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/vendor/magento/framework/App/Http.php:120
[24-Dec-2020 09:39:54 UTC] PHP   5. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:24
[24-Dec-2020 09:39:54 UTC] PHP   6. Magento\Backend\Model\View\Result\Page\Interceptor->render() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Layout.php:171
[24-Dec-2020 09:39:54 UTC] PHP   7. Magento\Backend\Model\View\Result\Page\Interceptor->renderPage() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:260
[24-Dec-2020 09:39:54 UTC] PHP   8. include() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:327

I think problem consists in the way that is required the file vendor/amnuts/opcache-gui/index.php in admin template:

vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml

on line 46:

require_once DIR . '/../../../../vendor/amnuts/opcache-gui/index.php';

Genaker commented 3 years ago

Hi. Thanks for reporting. Why you admin uses view_preprocessed as a base path? Why template are included from the view preprocessed in the admin are? Holly broken Magento 2.

I will fix that.

On Thu, Dec 24, 2020 at 3:58 AM Garde85 notifications@github.com wrote:

Error include_path adminhtml/templates/index/gui.phtml Issue Description Preconditions

  1. Magento Open source 2.3.5-p2.
  2. genaker/module-opcache

Steps to reproduce

  1. Deploy magento production mode
  2. Access to magento admin panel
  3. Go to System > React > Opcache Gui

Expected result:

Opcache gui page showing opcache configurations https://github.com/Genaker/Magento2OPcacheGUI#magento-2-opcache-gui Actual result:

Missing opache gui informations

[image: image] https://user-images.githubusercontent.com/13488417/103084125-83218380-45de-11eb-9bc9-f8e562d77cb1.png Additional information

In my erroe log i find this error:

[24-Dec-2020 09:39:54 UTC] PHP Fatal error: Magento\Framework\View\Result\Page::main(): Failed opening required '/var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/var/www/myhost/htdocs/vendor/genaker/module-opcache/vendor/amnuts/opcache-gui/index.php' (include_path='/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml on line 1 [24-Dec-2020 09:39:54 UTC] PHP Stack trace: [24-Dec-2020 09:39:54 UTC] PHP 1. {main}() /var/www/myhost/htdocs/pub/index.php:0 [24-Dec-2020 09:39:54 UTC] PHP 2. Magento\Framework\App\Bootstrap->run() /var/www/myhost/htdocs/pub/index.php:45 [24-Dec-2020 09:39:54 UTC] PHP 3. Magento\Framework\App\Http->launch() /var/www/myhost/htdocs/vendor/magento/framework/App/Bootstrap.php:261 [24-Dec-2020 09:39:54 UTC] PHP 4. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/vendor/magento/framework/App/Http.php:120 [24-Dec-2020 09:39:54 UTC] PHP 5. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:24 [24-Dec-2020 09:39:54 UTC] PHP 6. Magento\Backend\Model\View\Result\Page\Interceptor->render() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Layout.php:171 [24-Dec-2020 09:39:54 UTC] PHP 7. Magento\Backend\Model\View\Result\Page\Interceptor->renderPage() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:260 [24-Dec-2020 09:39:54 UTC] PHP 8. include() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:327

I think problem consist in the way that is require the file vendor/amnuts/opcache-gui/index.php in admin template:

vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml

on line 46:

require_once DIR . '/../../../../vendor/amnuts/opcache-gui/index.php';

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Genaker/Magento2OPcacheGUI/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGJNZVZIADBEDD5SQKXRD3SWMNGDANCNFSM4VICTMJQ .

Genaker commented 3 years ago

You can easily fix that by disable html magnification. It is definitely one of the Magento core issues. No reason to minify admin phtml files.

You just found 2 Magento core bags in on issue.

Or include that microservices file in the controller to avoid using Magento's logic.

ob_start();

/* path to the controller

Controller/adminhtnl/index/

*/

require_once DIR . '/../../../vendor/amnuts/opcache-gui/index.php';

$buffer = ob_get_clean();

$this->getResponse()->setBody($buffer);

Also what type of environment are you using?

You are having not stable php performance.

On Fri, Dec 25, 2020 at 1:54 AM Yehor Shytikov egorshitikov@gmail.com wrote:

Hi. Thanks for reporting. Why you admin uses view_preprocessed as a base path? Why template are included from the view preprocessed in the admin are? Holly broken Magento 2.

I will fix that.

On Thu, Dec 24, 2020 at 3:58 AM Garde85 notifications@github.com wrote:

Error include_path adminhtml/templates/index/gui.phtml Issue Description Preconditions

  1. Magento Open source 2.3.5-p2.
  2. genaker/module-opcache

Steps to reproduce

  1. Deploy magento production mode
  2. Access to magento admin panel
  3. Go to System > React > Opcache Gui

Expected result:

Opcache gui page showing opcache configurations https://github.com/Genaker/Magento2OPcacheGUI#magento-2-opcache-gui Actual result:

Missing opache gui informations

[image: image] https://user-images.githubusercontent.com/13488417/103084125-83218380-45de-11eb-9bc9-f8e562d77cb1.png Additional information

In my erroe log i find this error:

[24-Dec-2020 09:39:54 UTC] PHP Fatal error: Magento\Framework\View\Result\Page::main(): Failed opening required '/var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/var/www/myhost/htdocs/vendor/genaker/module-opcache/vendor/amnuts/opcache-gui/index.php' (include_path='/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml on line 1 [24-Dec-2020 09:39:54 UTC] PHP Stack trace: [24-Dec-2020 09:39:54 UTC] PHP 1. {main}() /var/www/myhost/htdocs/pub/index.php:0 [24-Dec-2020 09:39:54 UTC] PHP 2. Magento\Framework\App\Bootstrap->run() /var/www/myhost/htdocs/pub/index.php:45 [24-Dec-2020 09:39:54 UTC] PHP 3. Magento\Framework\App\Http->launch() /var/www/myhost/htdocs/vendor/magento/framework/App/Bootstrap.php:261 [24-Dec-2020 09:39:54 UTC] PHP 4. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/vendor/magento/framework/App/Http.php:120 [24-Dec-2020 09:39:54 UTC] PHP 5. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:24 [24-Dec-2020 09:39:54 UTC] PHP 6. Magento\Backend\Model\View\Result\Page\Interceptor->render() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Layout.php:171 [24-Dec-2020 09:39:54 UTC] PHP 7. Magento\Backend\Model\View\Result\Page\Interceptor->renderPage() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:260 [24-Dec-2020 09:39:54 UTC] PHP 8. include() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:327

I think problem consist in the way that is require the file vendor/amnuts/opcache-gui/index.php in admin template:

vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml

on line 46:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Genaker/Magento2OPcacheGUI/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGJNZVZIADBEDD5SQKXRD3SWMNGDANCNFSM4VICTMJQ .

Genaker commented 3 years ago

Error include_path adminhtml/templates/index/gui.phtml

Issue Description

Preconditions

1. Magento Open source 2.3.5-p2.
2. genaker/module-opcache

Steps to reproduce

1. Deploy magento production mode
2. Access to magento admin panel
3. Go to System > React > Opcache Gui

Expected result:

Opcache gui page showing opcache configurations https://github.com/Genaker/Magento2OPcacheGUI#magento-2-opcache-gui

Actual result:

Missing opache gui informations:

image

Additional information

In my error log i find this error:

[24-Dec-2020 09:39:54 UTC] PHP Fatal error:  Magento\Framework\View\Result\Page::main(): Failed opening required '/var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/var/www/myhost/htdocs/vendor/genaker/module-opcache/vendor/amnuts/opcache-gui/index.php' (include_path='/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/generated/code:/var/www/myhost/htdocs/vendor/magento/zendframework1/library:.:/usr/share/php') in /var/www/myhost/htdocs/var/view_preprocessed/pub/static/vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml on line 1
[24-Dec-2020 09:39:54 UTC] PHP Stack trace:
[24-Dec-2020 09:39:54 UTC] PHP   1. {main}() /var/www/myhost/htdocs/pub/index.php:0
[24-Dec-2020 09:39:54 UTC] PHP   2. Magento\Framework\App\Bootstrap->run() /var/www/myhost/htdocs/pub/index.php:45
[24-Dec-2020 09:39:54 UTC] PHP   3. Magento\Framework\App\Http->launch() /var/www/myhost/htdocs/vendor/magento/framework/App/Bootstrap.php:261
[24-Dec-2020 09:39:54 UTC] PHP   4. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/vendor/magento/framework/App/Http.php:120
[24-Dec-2020 09:39:54 UTC] PHP   5. Magento\Backend\Model\View\Result\Page\Interceptor->renderResult() /var/www/myhost/htdocs/generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:24
[24-Dec-2020 09:39:54 UTC] PHP   6. Magento\Backend\Model\View\Result\Page\Interceptor->render() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Layout.php:171
[24-Dec-2020 09:39:54 UTC] PHP   7. Magento\Backend\Model\View\Result\Page\Interceptor->renderPage() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:260
[24-Dec-2020 09:39:54 UTC] PHP   8. include() /var/www/myhost/htdocs/vendor/magento/framework/View/Result/Page.php:327

I think problem consists in the way that is required the file vendor/amnuts/opcache-gui/index.php in admin template:

vendor/genaker/module-opcache/view/adminhtml/templates/index/gui.phtml

on line 46:

require_once DIR . '/../../../../vendor/amnuts/opcache-gui/index.php';

The issue was fixed and merged. you can try