4

I've seen two other threads with this issue but I have been unable to resolve it with the solutions provided.

I've increased my memory limit to 1G in php.ini and I've set ini_set('memory_limit','2G'); right under my <?php tag in bin/magento.

In PuTTY I run; /usr/local/php56/bin/php-cli /home/lfcstage/public_html/bin/magento deploy:mode:set production which returns; Command returned non-zero exit code: php -f /home/lfcstage/public_html/bin/magento setup:static-content:deploy en_US 2>&1

However, when I run;

/usr/local/php56/bin/php-cli /home/lfcstage/public_html/bin/magento deploy:mode:set production

it completes successfully so I don't understand why I still can't toggle my mode back to production from developer.

I'm hosted on a cloud solution with SiteGround. Specs: 1 x 3.0 GHz CPU Cores, CentOS, 2GB RAM, 20GB SSD, cPanel, Cloud Storage, Management Services

2
  • 1
    Try to add "-vvv" key to your console command. It should give you more details about the error.
    – Amasty
    Jun 17 '16 at 9:14
  • @Aus-tn did you find a resolution? I'm with siteground cloud and encounter the same issue. Oct 22 '19 at 23:56
6

Turns out Magento was not able to compile on my SiteGround build. I could switch it back when I ran;

/usr/local/php56/bin/php-cli bin/magento deploy:mode:set production --skip-compilation

Stay away from SiteGround with Magento 2 IMO, clean installs of Magento 2 just do not work.

2

I resolved this issue by using these commands.

Run this commands

  1. sudo php bin/magento maintenance:disable
  2. clear cache
  3. sudo chmod 777 var* -R
  4. sudo chmod 777 pub* -R
1
  • 2
    Setting anything to 777 is never the answer
    – BrianVPS
    Jun 30 '20 at 17:36

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.