cancel
Showing results for 
Search instead for 
Did you mean: 

production mode not working

SOLVED

production mode not working

Hi,

 

I am running magento 2.2.2, it's been working fine, but recently I had a problem and switched magento to developer mode, which the problem was solved. but when I went to switch back to production mode, I am getting an error and the page is not loaded, just a blank page.

 

this is the log:

[2019-02-20 15:34:30] main.INFO: php.exe -f \bin\magento setup:di:compile 2>&1
Compilation was started.
%message% 0/7 [>---------------------------]   0% < 1 sec 48.0 MiB%message% 0/7 [>---------------------------]   0% < 1 sec 48.0 MiBProxies code generation... 0/7 [>---------------------------]   0% < 1 sec 48.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 1 sec 50.0 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 50.0 MiB
Repositories code generation... 2/7 [========>-------------------]  28% 32 secs 174.0 MiB
Service data attributes generation... 2/7 [========>-------------------]  28% 32 secs 174.0 MiB
Service data attributes generation... 3/7 [============>---------------]  42% 32 secs 174.0 MiB
Application code generator... 3/7 [============>---------------]  42% 32 secs 174.0 MiB
Application code generator... 4/7 [================>-----------]  57% 1 min 194.0 MiB
Interceptors generation... 4/7 [================>-----------]  57% 1 min 194.0 MiB
Interceptors generation... 5/7 [====================>-------]  71% 1 min 214.0 MiB
Area configuration aggregation... 5/7 [====================>-------]  71% 1 min 214.0 MiB
Area configuration aggregation... 6/7 [========================>---]  85% 1 min 276.0 MiB
Interception cache generation... 6/7 [========================>---]  85% 1 min 276.0 MiB
Interception cache generation... 7/7 [============================] 100% 1 min 276.0 MiB
Generated code and dependency injection configuration successfully. [] []
[2019-02-20 15:38:38] main.INFO: php.exe -f \bin\magento setup:static-content:deploy -f en_GB en_US 2>&1

Deploy using quick strategy
frontend/Magento/blank/en_GB            0/2914              >--------------------------- 0% %    < 1 sec
frontend/Magento/blank/en_GB            5/2914              >--------------------------- 0% %    1 sec
frontend/Magento/blank/en_GB            283/2914            ==>------------------------- 9% %    2 secs
frontend/Magento/blank/en_GB            542/2914            =====>---------------------- 18% %   3 secs
frontend/Magento/blank/en_GB            606/2914            =====>---------------------- 20% %   4 secs
frontend/Magento/blank/en_GB            704/2914            ======>--------------------- 24% %   5 secs
frontend/Magento/blank/en_GB            742/2914            =======>-------------------- 25% %   6 secs
frontend/Magento/blank/en_GB            1025/2914           =========>------------------ 35% %   7 secs
frontend/Magento/blank/en_GB            1268/2914           ============>--------------- 43% %   8 secs
frontend/Magento/blank/en_GB            1471/2914           ==============>------------- 50% %   9 secs
frontend/Magento/blank/en_GB            1601/2914           ===============>------------ 54% %   10 secs
frontend/Magento/blank/en_GB            1779/2914           =================>---------- 61% %   11 secs
frontend/Magento/blank/en_GB            1950/2914           ==================>--------- 66% %   12 secs
frontend/Magento/blank/en_GB            1989/2914           ===================>-------- 68% %   13 secs
frontend/Magento/blank/en_GB            2189/2914           =====================>------ 75% %   14 secs
frontend/Magento/blank/en_GB            2266/2914           =====================>------ 77% %   15 secs
frontend/Magento/blank/en_GB            2405/2914           =======================>---- 82% %   16 secs
frontend/Magento/blank/en_GB            2551/2914           ========================>--- 87% %   17 secs
frontend/Magento/blank/en_GB            2689/2914           =========================>-- 92% %   18 secs
frontend/Magento/blank/en_GB            2815/2914           ===========================> 96% %   19 secs
frontend/Magento/blank/en_GB            2818/2914           ===========================> 96% %   20 secs
frontend/Magento/blank/en_GB            2819/2914           ===========================> 96% %   24 secs
frontend/Magento/blank/en_GB            2914/2914           ============================ 100% %  24 secs
frontend/Magento/blank/en_GB            2914/2914           ============================ 100% %  24 secs
adminhtml/Magento/backend/en_GB         2360/2360           ============================ 100% %  19 secs
frontend/Magento/blank/en_US            2914/2914           ============================ 100% %  29 secs
frontend/Magento/luma/en_GB             2930/2930           ============================ 100% %  33 secs
adminhtml/Magento/backend/en_US         2360/2360           ============================ 100% %  20 secs
frontend/Magento/bitsbytes/en_GB        2935/2935           ============================ 100% %  26 secs
frontend/Magento/luma/en_US             2930/2930           ============================ 100% %  26 secs
frontend/Magento/bitsbytes/en_US        2935/2935           ============================ 100% %  30 secs

Execution time: 241.11057186127 [] []
</pre>
1 ACCEPTED SOLUTION

Accepted Solutions

Re: production mode not working

I have found the solution. it was this:

 

1. Switch to production mode (php bin/magento deploy:mode:set production)
2. Clean and flush cache:
          php bin/magento cache:clean
          php bin/magento cache:flush
3. Run composer install, I know that it does not make sense, from magento root: composer install
4. It will report that there is nothing to install or update but now magically everything is working fine.

View solution in original post

12 REPLIES 12

Re: production mode not working

Hello @robertbits ,

 

I can't see any error in terminal text.

 

Please run below command to make production mode 

php bin/magento deploy:mode:set production


--
If my answer is useful, please Accept as Solution & give Kudos

Re: production mode not working

@gelanivishal 

I was referring to this part:

frontend/Magento/blank/en_GB

I have run the command you told me, that command I use it to switch the mode. but when finishes the frontend is a blank screen and the backend gives me this error:

 

This page isn’t working 10.1.1.3 redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

Re: production mode not working

I have found the solution. it was this:

 

1. Switch to production mode (php bin/magento deploy:mode:set production)
2. Clean and flush cache:
          php bin/magento cache:clean
          php bin/magento cache:flush
3. Run composer install, I know that it does not make sense, from magento root: composer install
4. It will report that there is nothing to install or update but now magically everything is working fine.

Re: production mode not working

I am having the same issue but, your "composer install" does not work and I need to know more. Where did you find your solution? What "composer install" command did you run?

Re: production mode not working

@robert_w 

 

Basically, what I did was this:

  1. I set windows powershell in the magento directory.
  2. run the command: php bin/magento deploy:mode:set production
  3. then: php bin/magento cache:clean
  4. and: php bin/magento cache:flush
  5. then run the command: composer install

when I ran "composer install", I got a message that nothing was installed and updated, but when I checked the website it worked fine.

http://prntscr.com/mxti21

 

if you still don't work, check the \var\log\ to see if there is any indication what is happening.

 

Re: production mode not working

If enabling production mode has broken all the shop pages. Run below commands in sequence.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex

 

Note: Here we are not compiling again. It is assumed that the compilation was successful while enabling the production mode.

 

Magento 2 extensions at affordable price

Re: production mode not working

It's not a solution. composer install creates .regenerate file in var directory. Next openning a page Magento will clear generated folder. That's why you can see a page.

Re: production mode not working

I have same issue. After follow @robertbits steps. Its working fine for me.

 

Thanks @robertbits 

Re: production mode not working

Thank you soooooooo much it works, it tried many other solution but it didn't work your sloution was helpful 


@robertbits wrote:

I have found the solution. it was this:

 

1. Switch to production mode (php bin/magento deploy:mode:set production)
2. Clean and flush cache:
          php bin/magento cache:clean
          php bin/magento cache:flush
3. Run composer install, I know that it does not make sense, from magento root: composer install
4. It will report that there is nothing to install or update but now magically everything is working fine.