Magento installation issues

magento-installation-issues

Solving the PluginListGenerator.php Error in Magento 2

Error occurs while running the command “bin/magento setup:di:compile”

it is very hectic when all good goin code stops due to unknown issues,

One of this issue is “file not found” during compile the setup of magento 2

If you’ve ever encountered the frustrating file_put_contents error while working with Magento 2, you’re not alone. This common issue occurs during the setup:di:compile command, and the error looks something like this:

				
					file_put_contents(~/mag246/generated/metadata/primary|global|plugin-list.php): failed to open stream: No such file or directory in mag246\vendor\magento\framework\Interception\PluginListGenerator.php

				
			

Here’s a step-by-step solution to fix this error quickly and easily.

  1. Open PluginListGenerator.php located at vendor/magento/framework/Interception.
    • ~/vendor/magento/framework/Interception/PluginListGenerator.php
  2. find function public function write(array $scopes): void at line no 148
  3. find line no 156 OR line given bellow
    • $cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
    • and replace with
    • $cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;
  4. Save the file and run bin/magento setup:di:compile.
  5. bin/magento c:c

That’s it.

				
					$cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
				
			

Change with

				
					$cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;
				
			

Leave a Reply

Your email address will not be published. Required fields are marked *