{"id":1564,"date":"2021-01-31T06:46:07","date_gmt":"2021-01-31T06:46:07","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solution-to-failed-to-open-stream-error-while-compiling-pluginlistgenerator-php-in-magento-2-4-1\/"},"modified":"2025-09-01T11:47:15","modified_gmt":"2025-09-01T06:17:15","slug":"solution-to-failed-to-open-stream-error-while-compiling-pluginlistgenerator-php-in-magento-2-4-1","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solution-to-failed-to-open-stream-error-while-compiling-pluginlistgenerator-php-in-magento-2-4-1\/","title":{"rendered":"Solved: Failed to Open Stream Error While Compiling PluginListGenerator.php in Magento 2.4.1"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2&nbsp;is a preferable choice for E-commerce stores serving the global customer base, owing to the flexibility and customization options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento releases upgraded versions to\u00a0<a href=\"https:\/\/meetanshi.com\/blog\/speed-up-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">improve the store performance<\/a>\u00a0and it is highly recommended to\u00a0<a href=\"https:\/\/meetanshi.com\/magento-upgrade-service.html\" target=\"_blank\" rel=\"noreferrer noopener\">upgrade to the latest Magento 2 version<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, sometimes the developers face errors while migrating, upgrading, customizing or performing any operations on the Magento 2 store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of them is&nbsp;<em><strong>failed to open stream error while compiling PluginListGenerator.php in Magento 2.4.1<\/strong><\/em>&nbsp;that says,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">file_put_contents(C:\/xampp\/htdocs\/Yash\/mag241sample\/generated\/metadata\/primary|global|plugin-list.php): failed to open stream: No such file or directory in C:xampphtdocsYashmag241samplevendormagentoframeworkInterceptionPluginListGenerator.php on line 414<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may face this error while running the command \u201cbin\/magento setup:di:compile\u201d in&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-4-1-release\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2.4.1<\/a>&nbsp;using XAMPP.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/01\/Screenshot-at-January-13th-2021-6.33.30-pm-2.png\" alt=\"Error while compile\" class=\"wp-image-12866\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This error may also occur after upgrading your Magento 2 from an older version to Magento 2.4.1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the solution for the same below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution for Failed to Open Stream Error While Compiling PluginListGenerator.php in Magento 2.4.1<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. Open&nbsp;<strong>PluginListGenerator.php&nbsp;<\/strong>file located at&nbsp;<strong>vendor\/magento\/framework\/Interception.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Replace the line<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cacheId = implode('|', $this->scopePriorityScheme) . \"|\" . $this->cacheId;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">with below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$cacheId = implode('-', $this->scopePriorityScheme) . \"-\" . $this->cacheId;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Save the&nbsp;<strong>PluginListGenerator.php&nbsp;<\/strong>file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now your \u201cbin\/magento setup:di:compile\u201d command will run successfully without any error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the solution with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2&nbsp;is a preferable choice for E-commerce stores serving the global customer base, owing to the flexibility and customization options. Magento releases upgraded versions to\u00a0improve the store performance\u00a0and it is highly recommended to\u00a0upgrade to the latest Magento 2 version. However, sometimes the developers face errors while migrating, upgrading, customizing or performing any operations on the [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1564","post","type-post","status-publish","format-standard","hentry","category-magento"],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1564"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1564\/revisions"}],"predecessor-version":[{"id":21410,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1564\/revisions\/21410"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}