-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twitter bootstrap #4
Comments
What's the issue? Please provide more details. I've compressed successfully Bootstrap 2.0.4 using the compressor my company hosts here: http://www.margenn.com/csscompressor Try it if you want. |
It is very strange, because same css file work well on your site, but on my computer (Windows, Apache, Php 5.3) cause issue "Error 101(net::ERR_CONNECTION_RESET): Connection reset". I found that there is a problem with calling this "$css = preg_replace_callback('/(?:^|})(?:(?:[^{:])+:)+(?:[^{]*{)/', array($this, 'replace_colon'), $css);" on bootstrap.css I don't know why. There is no error message, no log nothing just this. |
Ummm, if you Google "Error 101(net::ERR_CONNECTION_RESET): Connection reset" you'll see there are many people who had that issue. Are you using a database connection (MySQL) when the compressor runs? check this out: http://serverfault.com/questions/74313/what-could-cause-an-101-error-in-wamp-under-windows-7 As a side note: Windows + Apache = issues! |
After more than hour of browsing and searching I found this: http://stackoverflow.com/questions/7620910/regexp-in-preg-match-function-returning-browser-error Problem was somewhere else. Sorry for my false |
I have to investigate this problem more. On my developper station (Windows XP, Php 5.3.14, Apache/2.2.22) I still have an issue "Error 101(net::ERR_CONNECTION_RESET): Connection reset". After some investigating I found that core of the problem is in pcre.recursion_limit parameter in php.ini. After that I found, that CssMin set this value itself. When I call CssMin with FALSE value of constructor parametter $raise_php_limits, Problem with error 101 disappear.!!!! Unfortunetly, there is another issue. CssMinificator completly delete content of first chunk of twitter bootstrap.css |
So not increasing PCRE limits can cause crashes, and raising PCRE limits via ini_set can cause crashes! I love PCRE. |
Try lowering the chunk length to 10.000 chars or even less until it doesn't break. Default is 25.000 chars $css_chunk_length = 25000; // aprox size, not exact |
Hi mikeytown2, I can't find any issues with your code. I've compressed it successfully several times using the gui: http://www.margenn.com/csscompressor |
Tested on a windows box. I've played around with the PCRE limits and chunk length and it still dies with no error in the php error log; xdebug output is incomplete. I guess I'll make that code conditional; only run if not windows. http://stackoverflow.com/questions/5879043/php-script-detect-whether-running-under-linux-or-windows |
I don't have a Windows environment to test this but google a bit and you'll find many topics discussing issues with Windows + Apache/mod_php and PCRE limits such as this one: http://stackoverflow.com/questions/3457039/apache-php-on-windows-crashes-with-regular-expression which suggests it maybe a bug with the PHP version/compilation used. My suggestion: Don't use Windows if possible, upgrade Apache and PHP to the latest stable release. I'm closing this issue. |
Apologies for re-opening this but I'v having the exact same issue on OSX + MAMP and extending the check on line 290 to ignore "DAR" as well (OSX == Darwin apparently) fixes it for me... |
FYI I'm seeing people have more of these crashes with Bootstrap 3's CSS file. I have a section on this wiki page, is there anything you would add? |
I'll give the bootstrap 3 a try with the compressor and report back ;) |
I've just released version 2.4.8-2. I've reduced the chunk length by 5x so it's now 5.000 chars. Most PCRE issues should be gone. Give it a go!! |
We have problem with compressing bootstrap.css
There is an error somewhere over:
$css = preg_replace_callback('/(?:^|})(?:(?:[^{:])+:)+(?:[^{]*{)/', array($this, 'replace_colon'), $css);
$css = preg_replace('/\s+([!{};:>+()]~=,])/', '$1', $css);
$css = preg_replace('/' . self::CLASSCOLON . '/', ':', $css);
The text was updated successfully, but these errors were encountered: