i was having an error on frontend enter image description here

after looking for an answer here i got an answer :Magento 2 error: We're sorry, an error has occurred while generating this email according to which i enabled the developers mode by command line as:

php bin/magento deploy:mode:set developer and then clearing the caches: php bin/magento cache:flush and after refreshing the front page it gave me a crazy list of errors :

enter image description here

can someone guide me what to do now because my website was running but now customers have started to move on to other websites which i a great shock to me as it is a huge projct for me.

  • 1
    Well you should never ever enable develop mode on a production site and that too after it is live for customers. Simply now set it to production mode again. – Shireen N Mar 22 '18 at 7:03
  • how can i set it to production mode again? – Laiba Mar 22 '18 at 7:04
  • 1
    Run this command : php bin/magento deploy:mode:set production. Keep patience while it is running because there will be some processes taking place which will take some time to finish. Good Luck! – Shireen N Mar 22 '18 at 7:05
  • hey i tried this and now its showing Service Temporarily Unavailable Error 503 – Laiba Mar 22 '18 at 7:07
  • check if this post helps - magento.stackexchange.com/questions/90064/… – Shireen N Mar 22 '18 at 7:10

You can try following step may be it can help you :

  1. Remove all data inside directory :

    var/cache var/di var/generation var/view_preprocessed pub/static

  2. check if maintenannce.flag file exist in root/var/ directory delete that file as well

  3. run command bin/magento deploy:mode:set production

  4. clear cache bin/magento c:f
  5. check permission of file and folder (important to check) try to hit base url in browser.
| improve this answer | |
  • You should really explain what these steps are doing. It was by running commands without knowing what they do that got the OP into his mess in the first place. – ProcessEight Jul 30 '18 at 9:03
  • Actually I am considering the person who is performing a task should have basic knowledge of magento default command . But If you need explanation you have following option just run : – Shashank Gupta Jul 30 '18 at 11:23
  • Actually I am considering the person who is performing a task should have basic knowledge of magento default command . But If you need explanation you have following option just run : bin/magento in root folder all command are well explained . secondly : deleting file under view processed will delete all static file magento generate for caching purpose . deploy mode command will change mode from developer to production . bin/magento c:f remove all cache files . and permission you need to check according to you configuration . – Shashank Gupta Jul 30 '18 at 11:32
  • you can use chown and chmod command for setting owner and file permission – Shashank Gupta Jul 30 '18 at 11:34
  • Remember that developers (and not just the OP) use Stack Exchange to learn, not just find answers to one-off questions. So explaining what the commands do is essential to help developers do that. – ProcessEight Jul 30 '18 at 11:38

There are simple steps to overcome this:

  1. Empty content of root/var/cache/, /var/page_cache/, /var/log, /var/report ,/var/di , var/generation var/view_preprocessed
  2. run php bin/magento setup:upgrade
  3. run php bin/magento setup:di:compile
  4. run php bin/magento cache:clean
  5. run php bin/magento flush
  6. run 4. run php bin/magento setup:static-content:deploy -f or setup:static-content:deploy
  7. clear cache again
  8. Every thing will be fine
| improve this answer | |
  • There is no such command as php bin/magento flush. Also, there is no need to flush cache twice. Finally, switching to production mode will execute these steps, so you could've just said that (like the accepted answer). – ProcessEight Jul 30 '18 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.