I am done with all the work of my website but now when I try to set it to production mode, it abruptly terminates in shell without giving any error details in log file. At least I was not able to identify if it has some useful info that can guide me to troubleshoot.

Here is what I did to achieve it after the command to set in production mode failed:

  1. I deleted the content inside the folders "generated", "var/cache", "var/page_cache", "var/tmp" and "var/view_preprocessed".

  2. The folder permissions are set as follows: generated: 0777


    var/page_cache: 0755

    var/tmp: 0755

    var/view_preprocessed: 0755

  3. After deletion of folders, I ran following commands in sequence:

    php bin/magento setup:upgrade

    php -d memory_limit=-1 bin/magento setup:static-content:deploy -s standard -f

    php bin/magento cache:flush

    The above three commands run successfully.

  4. Now, to set production mode, I ran following command:

    php -d memory_limit=-1 bin/magento deploy:mode:set production

    This is what I got on shell screen:

    Enabled maintenance mode Starting compilation Something went wrong while compiling generated code. See the error log for details. Command returned non-zero exit code: /opt/alt/php70/usr/bin/php -f /home/admin/pl.com/bin/magento setup:di:compile

I checked the log file "system.log" and found following entry after I ran above command:

[2018-02-06 07:54:30] main.ERROR: /opt/alt/php70/usr/bin/php -f /home/admin/pl.com/bin/magento setup:di:compile 2>&1
Compilation was started.
%message% 0/7 [>---------------------------]   0% < 1 sec 52.0 MiB%message% 0/7 [>---------------------------]   0% < 1 sec 52.0 MiBProxies code generation... 0/7 [>---------------------------]   0% < 1 sec 52.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 1 sec 56.0 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 56.0 MiB<html>
    <style type="text/css">
        .required {color: red;}
    <style type="text/css">
        .required {color: red;}
</html> [] []

Can someone help me on this. Am I missing something in my steps to set it in production mode.

  • have you check server php/apache error log? – MagenX Feb 6 '18 at 8:16
  • No I did not check it. I tried look where this log can be found. But could not find it. Can you please tell me where can i find this log file. I have a reseller account and I have hosted this site in a account within my reseller account. – Devanshu Feb 6 '18 at 8:22
  • @Devanshu you may check logs in <magento_root>/var/log directory check system.log and exception.log – Dhaval Solanki Feb 6 '18 at 8:27
  • Try to run your command with display errors option, like: php -d display_errors=on bin/magento setup:static-content:deploy -vvv – Siarhey Uchukhlebau Feb 6 '18 at 8:39
  • @Magento2Learner Thanks for reply. The exception.log is empty in my case. – Devanshu Feb 6 '18 at 9:30

Your Answer

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

Browse other questions tagged or ask your own question.