1

I attempted to speed up my website by bundling, merging, and minifying the JavaScript and CSS through the Admin.

Stores> Settings> Configuration> Advanced> and then Developer, and changed the five options from "No" to "Yes".

Now, my website loads really fast, but some of the graphic elements like the shopping cart icon are just empty squares, and other elements are stretched and out of their places. Also, I can't place anything in the cart.

The "Stores" tab no longer works in the Admin sidebar, so I can't get back in to reverse the changes. Also, the graphic elements in the Admin sidebar are empty boxes also.

I have only been able to find a possible solution for Magento version 1.x, and I haven't found the database entries that were mentioned in my version, which is 2.1.8 CE.

I have backups of my entire website, including the database and the Magento installation.

I am database savy, so if anyone knows which database settings I need to change to set the options back to "No", and which bundled, merged, and minified JavaScript and CSS files (I assume they are in pub/static) I need to replace with the ones from my backups, or other solutions that work, please let me know.

If it is of any help, the store was installed through my cPanel using Softaculous, and there are no third-party extensions in use.

I have no intention of using bundling, merging, and minifying again.

Thank you very much for your help.

These are some of the things that I have tried:

Switching back and forward from developer mode to production mode;

Emptied some 'var' folders;

php bin/magento setup:upgrade;

php -f /home/eq/public_html/bin/magento indexer:reindex;

php bin/magento deploy:mode:set production -s;

php -f /home/eq/public_html/bin/magento setup:di:compile;

php bin\magento setup:static-content:deploy;

php -f /home/eq/public_html/bin/magento cache:flush;

php -f /home/eq/public_html/bin/magento cache:clean;

php bin\magento setup:static-content:deploy;

1 Answer 1

3

The values are stored in core_config_data. The paths for these are:

  • dev/css/merge_css_files
  • dev/css/minify_files
  • dev/js/merge_files
  • dev/js/minify_files
  • dev/js/enable_js_bundling

Set these all back to '0'. Or, you can run the following:

UPDATE core_config_data SET value = 0 WHERE path = 'dev/css/merge_css_files';
UPDATE core_config_data SET value = 0 WHERE path = 'dev/css/minify_files';
UPDATE core_config_data SET value = 0 WHERE path = 'dev/js/merge_files';
UPDATE core_config_data SET value = 0 WHERE path = 'dev/js/minify_files';
UPDATE core_config_data SET value = 0 WHERE path = 'dev/js/enable_js_bundling';

Then you can attempt to rebuild everything (flush cache first). Also, I'd recommend never minifying JS in Magento. Ever.

4
  • Just as an aside: Merge CSS and JS in production all you want. That's generally a good idea, as it reduces the number of requests, and you generally don't run into issues (generally). I'd just avoid minification. Commented Aug 30, 2017 at 21:38
  • Thank you for replying. I finally changed the values in these: dev/css/merge_css_files dev/css/minify_files dev/js/merge_files dev/js/minify_files dev/js/enable_js_bundling. I couldn't find them before because I am not as database savy as I thought I was, especially with phpmyadmin. My question to you is, was I correct in assuming that my backup CSS and JavaScript files should be placed in the pub/static folder, after I delete the bundled, merged, and minified ones? I don't want to cause another disaster.
    – Krang
    Commented Aug 31, 2017 at 16:53
  • As of now, I replaced the bundled, merged, and minified files with the ones from my backup, but my Admin and Website are still not working as they should. Also, I failed to mention in my original post that I am getting the "504 Gateway Timeout" error when I try to do certain things in either the Admin or the Website. Anybody have any clues or ideas for what else needs to be done? Thank you.
    – Krang
    Commented Sep 1, 2017 at 20:46
  • I am accepted your answer because it helped me solve my problems. For others who need to know, the backup CSS and JavaScript files should indeed be placed in the pub/static folder. The "504 Gateway Timeout" errors have gone away. My Admin and Website are working normaly again as they should. It took a few DAYS for things to get back to normal after the changes I made. The location of core_config_data (on my webserver account) is at cPanel> phpMyAdmin> yourCartDatabaseName> scroll to core_config_data> then search for the CSS and JavaScript values to change back.
    – Krang
    Commented Sep 5, 2017 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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