- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 -
- 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
- 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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 works perfectly in developer mode but not in production
- Check Permissions: Verify file and directory permissions.
- Clear Files: Remove generated and static content.
- Disable Maintenance: Ensure it’s off.
- Verify env.php: Check database settings.
- Enable Logging: Turn on error reporting.
- Review Server Settings: Check Apache/Nginx config.
- Use CLI: Run commands via the command line.
- Check PHP: Ensure the correct version and extensions.
Finally, check var/log for errors.