Showing results for 
Search instead for 
Did you mean: 

Deploy Static Content breaks site

Deploy Static Content breaks site

I am running Magento 2.1 CE with the Porto Theme on Centos Linux, PHP 7.

When I change the mode to production I get this error:

Something went wrong while deploying static content. See the error log for details.

Command returned non-zero exit code:
`/opt/plesk/php/7.0/bin/php -f 

setup:static-content:deploy en_US`

If I run deploy static content by itself I get this error:

[Exception] Warning: Error while sending QUERY packet. PID=16938 in

/var/www/vhosts/ on line 228

It is causing CSS and JS files to not be rendered in /pub/static and I cannot access the admin backend.

I have done these things:

  • deleted everything in pub/static except the .htaccess file
  • deleted the generation, di, page_cache folders
  • set chmod to -R 777 on var and pub
  • set dev/js/merge_files to 0 in the database
  • changed the line in /app/etc/di.xml from Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\copy
  • ran update
  • ran compile
  • ran deploy static content
  • cleaned cache
  • flushed cache
  • rebooted server

Nothing works... when you login to admin none of the left navigation buttons work and the javascript console shows 404 errors on a bunch of JS files. The /var/log/exception and var/log/debug log files show nothing when I tail -f them and run deploy static content, even when the error appears in the terminal.



Re: Deploy Static Content breaks site



Try below command and see if it works.


php -d memory_limit=2G setup:static-content:deploy

Magento 2 Certified Solution Specialist (x2). Follow me on Twitter