cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 works perfectly in developer mode but not in production

Magento 2 works perfectly in developer mode but not in production

 

I have migrated a magento 2 install from one server to another. Copied the files, imported db etc. and in developer mode it works fine, all the pages display with the products, the admin portal works etc.

As soon as I put it into production mode nothing works at all. I have tried numerous suggestions the main ones being -

 

  1. after enabling production mode -
  • bin/magento setup:upgrade
  • bin/magento setup:di:compile php
  • bin/magento cache:clean php
  • bin/magento cache:flush
  • bin/magento setup:static-content:deploy -f en_US en_GB
  1. after enabling production mode -

clean the cache and then run "composer install" in the Magento root directory which obviously you shouldn't have to do but it apparently worked for some people.

 

All I get is an HTML 500 error when in production for both the site and the admin login page. There is nothing in the apache error log file.

 

I am not experienced with Magento but when in developer mode I was looking at the MAGEROOT/var/log files which were quite helpful. But when in production mode nothing seems to get added to the log files.

 

Can someone suggest how I can go about debugging this ?

 

Any and all suggestions welcome.

 

Thanks

1 REPLY 1

Re: Magento 2 works perfectly in developer mode but not in production

Hello!
try remove paste generated

rm -rf generated/*

After run

bin/magento setup:di:compile

if persist check ur permissions folders.

 


Verify if is maintenance mode:

to disable maintenance

bin/magento maintenance:disable


U can verify too the app/etc/env.php, follow the doc for creating corretely the env.
https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/files/config-refe...