magentomagento2magento2.1

setup:upgrade and setup:di:compile not working


I've been trying for a few days, but I never could.

I installed Magento 2.1.

I installed the theme and then modules activated via ssh (bin/magento).

Then bin/magento setup:upgrade and bin/magento setup:di:compile I'm getting some errors.

I’m using Plesk Onyx 17.8 on Centos 7

I’m using PHP 7.0.33 for Magento 2.1 on webserver.

PHP cli Version

-bash-4.2$ php -v
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.3, Copyright (c) 2002-2017, by ionCube Ltd.
-bash-4.2$ 

magento setup:upgrade output

-bash-4.2$ cd bin

-bash-4.2$ ./magento setup:upgrade
Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html

-bash-4.2$ 

Setup:upgrade output

-bash-4.2$ /opt/plesk/php/7.0/bin/php bin/magento setup:upgrade -vvv


  [ReflectionException]                                                            
  Class Magento\Framework\App\Config\Initial\Converter\Interceptor does not exist  



Exception trace:
 () at /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:19
 ReflectionClass->__construct() at /var/www/vhosts/example.com/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:19
...
...
...
 Symfony\Component\Console\Application->run() at /var/www/vhosts/example.com/httpdocs/bin/magento:23


setup:upgrade [--keep-generated] [--magento-init-params="..."]


-bash-4.2$ 

Setup:di:compile output

-bash-4.2$ /opt/plesk/php/7.0/bin/php bin/magento setup:di:compile -vvv
Compilation was started.
Repositories code generation... 
1/7 [====>-----------------------]  14% 1 sec 42.0 MiB

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 528384 bytes) in /var/www/vhosts/dotarz.com/httpdocs/vendor/zendframework/zend-code/src/Scanner/FileScanner.php on line 36

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

-bash-4.2$ 

Solution

  • Execute these command in the same order

    rm -rf var/generation;
    rm -rf var/cache;
    rm -rf var/page_cache;
    /opt/plesk/php/7.0/bin/php bin/magento setup:di:compile;
    /opt/plesk/php/7.0/bin/php bin/magento setup:static-content:deploy;
    /opt/plesk/php/7.0/bin/php bin/magento cache:clean;
    /opt/plesk/php/7.0/bin/php bin/magento cache:flush;