问题
I'm using a shared 1and1 package for a Magento website and it seems I can't use the standard approach of compressing css and js files via htaccess. I came across this http://mrrena.blogspot.co.uk/2009/01/how-to-compress-php-and-other-text.html which gave an interesting approach which seems to work. However, I need to put a php.ini file in every directory that has css or js files that I want compressed. For something like Magento, this is quite a pain. Is there any way I can use a hierarchical approach such as with htaccess?
回答1:
I discovered the .user.ini file which does precisely what I want. So now I have a single .user.ini file in my root folder and I've removed all of the php.ini files.
See here for some detail: http://php.net/manual/en/configuration.file.per-user.php (none of the online documentation I could find on .user.ini was particularly good).
来源:https://stackoverflow.com/questions/24876371/compressing-js-css-files-where-mod-deflate-not-available