cancel
Showing results for 
Search instead for 
Did you mean: 

Can't put store in to production mode

Can't put store in to production mode

My store was in production mode, but I took it to default mode to do some inline text editing, but when I tried to put it back in to production mode I get:

 

[root@zcebh968 shop]# bin/magento deploy:mode:set production
Enabling maintenance mode
Starting compilation
Something went wrong while compiling generated code. See the error log for details.
Disabling maintenance mode
Command returned non-zero exit code:
`/opt/cpanel/ea-php72/root/usr/bin/php -f /home/trigin2/public_html/stmp/shop/bin/magento setup:di:compile`
[root@zcebh968 shop]#

I tried increasing the memory limit in php.ini from 800M to 1024M as per an instruction I found online but it hasn't helped.

5 REPLIES 5

Re: Can't put store in to production mode

Hi @bigbob2 

The error is most likely related to the PHP memory_limit

Make sure you set it to at least 768M and it should work. 

If it still doesn't work for you, you can always skip Compilation and do it later:-

php bin/magento deploy:mode:set production --skip-compilation

 

It may help you!
Problem Solved? Please click on 'Kudos' & accept As Solution!

Problem solved? Click Accept as Solution!

Re: Can't put store in to production mode

I tried increasing the memory limit in php.ini from 800M to 1024M but it did not help.

I also tried your suggestion about skipping compile, that looked like it worked, but now the site gives the error:

 

An error has happened during application run. See exception log for details.

Re: Can't put store in to production mode

@bigbob2 

I am unable to see logs.
Can you please share log content as well.

 

Thank you.

Problem solved? Click Accept as Solution!

Re: Can't put store in to production mode

[2020-07-10 01:07:50] main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused {"report_id":"f3468f897b8059d728b653edb70245b7d60e5ad84518894c407ec9a8db19e94f","exception":"[object] (Zend_Db_Adapter_Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []
[2020-07-14 09:42:28] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 09:50:51] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 09:51:47] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 09:52:20] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 09:53:34] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 09:55:16] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:01:24] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:06:55] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:07:00] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:09:13] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:10:01] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:10:17] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:11:48] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:14:22] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []
[2020-07-14 10:15:23] main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /home/trigin2/public_html/stmpro.co.nz/shop/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []

Re: Can't put store in to production mode

Hi @bigbob2 

 

Below error related to database connection:

main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused 

Try to run all magento commands with -dmemory_limit=-1 

ex:
php -dmemory_limit=5G bin/magento set:upgrade
php -dmemory_limit=5G bin/magento setup:di:compile
php -dmemory_limit=5G bin/magento set:static-content:deploy
sudo chmod -R 777 var/ pub/ generated/

It may help you to resolve issue!

Problem solved? Click Accept as Solution!