cancel
Showing results for 
Search instead for 
Did you mean: 

URGENT Error while running php bin/magento setup:di:compile in CMD

URGENT Error while running php bin/magento setup:di:compile in CMD

Good Afternoon,

I'm installing Magento and after i run the command php bin/magento setup:di:compile in cmd it gives me this error message "Warning: Use of undefined constant ‘ - assumed '‘' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\magento\vendor\magento\framework\Interception\PluginListGenerator.php on line 159" which refers to this line 

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

what can i do to solve this ? please this is urgent

Thank You!

5 REPLIES 5

Re: URGENT Error while running php bin/magento setup:di:compile in CMD

Hello @anisrouism0e62 

 

Hope you are doing well,

 

Check out this solution https://support.magento.com/hc/en-us/articles/115002663433-Error-running-the-setup-di-compile-comman.... I think this will help you in solving your problem. 

 

Hit the Kudos button and accept as a solution.

Re: URGENT Error while running php bin/magento setup:di:compile in CMD

Replace the line-

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

with the code-

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

maybe you have a variable $s and omitted the $, or you forgot the quotation marks? 

 

Re: URGENT Error while running php bin/magento setup:di:compile in CMD

  1. Open PluginListGenerator.php file located at vendor/magento/framework/Interception.
  2. Replace the line
     
    1
    $cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
    with below:
     
    1
    $cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;

    1. Save the PluginListGenerator.php file.

    Now your “bin/magento setup:di:compile” command will run successfully without any error.

Re: URGENT Error while running php bin/magento setup:di:compile in CMD

I changed this line $cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId; to like this $cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;

 

in both pages but still I'm facing this issue Warning: Undefined property: Magento\Framework\Interception\PluginList\PluginList::$scopePriorityScheme in C:\xampp \htdocs\magento-new-project\lib\internal\Magento\Framework\Interception\PluginList\PluginList.php on line 220

can't able to resolve those issues in Magento2.4.magento-issue.png

Re: URGENT Error while running php bin/magento setup:di:compile in CMD

When running the command "php bin/magento setup:di:compile" in Command Prompt or CMD, if an error occurs, it can be due to several reasons. One possible reason is that there may be a problem with the PHP installation on the system, or there may be missing dependencies or extensions required by Magento. Another reason could be a conflict between different modules or extensions installed on the Magento store. In order to resolve the issue, one can try checking the PHP version and making sure all the necessary dependencies and extensions are installed. It may also be helpful to disable any recently installed modules or extensions to check if they are causing the issue. Additionally, clearing the cache and reindexing the store can also help resolve the problem. It is important to address the issue as soon as possible as it can prevent the store from functioning properly.