<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>de77.com</title>
	<atom:link href="http://de77.com/feed" rel="self" type="application/rss+xml" />
	<link>http://de77.com</link>
	<description>a few words about web development</description>
	<lastBuildDate>Wed, 16 May 2012 19:28:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[pChar] [FATAL] Pie chart can only accept one serie of data.</title>
		<link>http://de77.com/php/pchar-fatal-pie-chart-can-only-accept-one-serie-of-data</link>
		<comments>http://de77.com/php/pchar-fatal-pie-chart-can-only-accept-one-serie-of-data#comments</comments>
		<pubDate>Wed, 16 May 2012 19:28:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[char]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[pchar]]></category>

		<guid isPermaLink="false">http://de77.com/?p=676</guid>
		<description><![CDATA[The following error: "[FATAL] Pie chart can only accept one serie of data." can be thrown by pChar.]]></description>
			<content:encoded><![CDATA[<p>The following error: &#8220;[FATAL] Pie chart can only accept one serie of data.&#8221; can be thrown by pChart not only when you try to add more than 1 serie of data but also when you don&#8217;t add any points to any serie.<br />
This can happen for example when you add points to a chart from a database.<br />
This very misleading error message took my 15 minutes, so be warned!</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/php/pchar-fatal-pie-chart-can-only-accept-one-serie-of-data/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ERROR 2006 (HY000) at line 825: MySQL server has gone away</title>
		<link>http://de77.com/mysql/error-2006-hy000-at-line-825-mysql-server-has-gone-away</link>
		<comments>http://de77.com/mysql/error-2006-hy000-at-line-825-mysql-server-has-gone-away#comments</comments>
		<pubDate>Sun, 06 May 2012 18:28:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[huge]]></category>

		<guid isPermaLink="false">http://de77.com/?p=674</guid>
		<description><![CDATA[I got this error while importing an SQL file using mysql import tool. The file was quite big so my MySQL server just died.]]></description>
			<content:encoded><![CDATA[<p>I got this error while importing an SQL file using mysql import tool. The file was quite big so my MySQL server just died. I my.ini file I changed 2 values:</p>
<pre class="brush: plain;">
max_allowed_packet = 10M
wait_timeout = 120
</pre>
<p>If you don&#8217;t have them- add them.<br />
Then I restarted MySQL server. On linux you can try this command:</p>
<pre class="brush: plain;">
/etc/init.d/mysql restart
</pre>
<p>And your MySQL should be ready to import now.</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/mysql/error-2006-hy000-at-line-825-mysql-server-has-gone-away/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[CSS] How to rotate an element in pure CSS</title>
		<link>http://de77.com/css/css-how-to-rotate-an-element-in-pure-css</link>
		<comments>http://de77.com/css/css-how-to-rotate-an-element-in-pure-css#comments</comments>
		<pubDate>Sun, 06 May 2012 18:20:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[rotate]]></category>

		<guid isPermaLink="false">http://de77.com/?p=672</guid>
		<description><![CDATA[Rotating an element using CSS3 is very simple and is supported by all the fine browsers: Opera, Firefox, Safari, Chrome and even IE9. ]]></description>
			<content:encoded><![CDATA[<p>Rotating an element using CSS3 is very simple and is supported by all the fine browsers: Opera, Firefox, Safari, Chrome and even IE9. The code is as follows:</p>
<pre class="brush: plain;">
-moz-transform:    rotate(15deg); /* Firefox */
-o-transform:      rotate(15deg); /* Opera */
-webkit-transform: rotate(15deg); /*Safari+Chrome */
transform:         rotate(15deg); /* IE9 and others */
</pre>
<p>Unfortunatelly for IE7 and IE8 we need different code. If we want to rotate by 90, 180, 270 or 360 degrees we can use this:</p>
<pre class="brush: plain;">
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0); /* 0* */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); /* 90* */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); /* 180* */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* 270 * */
</pre>
<p>But if want to rotate by arbitraty value then we need to use some complex calculations using matrices. Here <a href="http://msdn.microsoft.com/en-us/library/ms533014%28VS.85%29.aspx">you can read more about them on MSDN</a>. For 20* you need code like this:</p>
<pre class="brush: plain;">
/*IE */
-ms-filter: &quot;progid:DXImageTransform.Microsoft.Matrix(M11=0.9659258262890683, M12=-0.2588190451025207, M21=0.2588190451025207, M22=0.9659258262890683, SizingMethod='auto expand')&quot;;
/* IE6 and 7 */
filter: progid:DXImageTransform.Microsoft.Matrix(
            M11=0.9659258262890683,
            M12=-0.2588190451025207,
            M21=0.2588190451025207,
            M22=0.9659258262890683,
            SizingMethod='auto expand');
</pre>
<p>However there is a <a href="http://www.useragentman.com/IETransformsTranslator/">very nice tool to calculated the params online</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/css/css-how-to-rotate-an-element-in-pure-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[MySQL] How to remove duplicate rows- the fast way</title>
		<link>http://de77.com/mysql/mysql-how-to-remove-duplicate-rows-the-fast-way</link>
		<comments>http://de77.com/mysql/mysql-how-to-remove-duplicate-rows-the-fast-way#comments</comments>
		<pubDate>Sun, 06 May 2012 18:12:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[unique]]></category>

		<guid isPermaLink="false">http://de77.com/?p=670</guid>
		<description><![CDATA[In this post you can two simple and fast method do remove duplicate rows from a MySQL table.]]></description>
			<content:encoded><![CDATA[<p>Below you can two simple and fast method do remove duplicate rows from a MySQL table.</p>
<p>Method 1<br />
Let&#8217;s create a new unique index, like this:</p>
<pre class="brush: plain;">
ALTER IGNORE TABLE `mytab` ADD UNIQUE INDEX(`mycol`)
</pre>
<p>Method 2<br />
Create a new table and copy content from old table to new one:</p>
<pre class="brush: plain;">
INSERT IGNORE INTO mytab2
SELECT * FROM mytab
</pre>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/mysql/mysql-how-to-remove-duplicate-rows-the-fast-way/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[IE8] HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)</title>
		<link>http://de77.com/javascript/ie8-html-parsing-error-unable-to-modify-the-parent-container-element-before-the-child-element-is-closed-kb927917</link>
		<comments>http://de77.com/javascript/ie8-html-parsing-error-unable-to-modify-the-parent-container-element-before-the-child-element-is-closed-kb927917#comments</comments>
		<pubDate>Sun, 06 May 2012 17:49:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://de77.com/?p=668</guid>
		<description><![CDATA[On one of my pages IE8 was not rendering content properly- like all the CSS styles were ignored. The error shown by the browser was:

HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)]]></description>
			<content:encoded><![CDATA[<p>On one of my pages IE8 was not rendering content properly- like all the CSS styles were ignored. The error shown by the browser was:</p>
<pre class="brush: plain;">
HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
</pre>
<p>After playing around a bit I found out Internet Explorer had problems with Javascript. So I put all JS from &lt;script&gt; tag inside jQuery&#8217;s:</p>
<pre class="brush: plain;">
$(document).ready(function()
{
	//code here
});
</pre>
<p>And it helped. All other browsers (Opera, Firefox) did not need it, but IE is retarded and seems it can&#8217;t render content properly without it.</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/javascript/ie8-html-parsing-error-unable-to-modify-the-parent-container-element-before-the-child-element-is-closed-kb927917/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCR (Optical Character Recognition) in PHP</title>
		<link>http://de77.com/php/ocr-optical-character-recognition-in-php</link>
		<comments>http://de77.com/php/ocr-optical-character-recognition-in-php#comments</comments>
		<pubDate>Tue, 06 Mar 2012 19:21:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[character recognition]]></category>
		<category><![CDATA[gocr]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[pnm]]></category>

		<guid isPermaLink="false">http://de77.com/?p=660</guid>
		<description><![CDATA[Ever wanted to extract text from images using PHP? That doesn't seem trivial, does it? But you will find it's not that hard after reading this article, so let's get started!
<br />&#160;
First- we need an OCR engine. I once written such thing in pure PHP, but it was so slow that it wasn't usable with bigger images. PHP is just not a perfect thing for such tasks.
<br />&#160;
Luckily there is a free OCR engine available for many platforms- including Windows and Linux that we can use as command-line app...]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to extract text from images using PHP? That doesn&#8217;t seem trivial, does it? But you will find it&#8217;s not that hard after reading this article, so let&#8217;s get started!<br />
<br />&nbsp;<br />
First- we need an OCR engine. I once written such thing in pure PHP, but it was so slow that it wasn&#8217;t usable with bigger images. PHP is just not a perfect thing for such tasks.<br />
<br />&nbsp;<br />
Luckily there is a free OCR engine available for many platforms- including Windows and Linux that we can use as command-line app. It&#8217;s called <a href="http://jocr.sourceforge.net/download.html">GOCR and it&#8217;s located here</a>. You can choose Windows or OS/2 binaries or packages for Fedora, Debian, SuSE and other. It&#8217;s open sourced so you can grab source code and compile it for yourself if you can&#8217;t find binaries for your platform.<br />
<br />&nbsp;<br />
Once we have GOCR we need a script in PHP to call the program from command line and get the results. Unfortunatelly GOCR does not support any of the PHP built-in image formats (png, jpeg, gif, xbm) so we need something to convert source image into something suitable for GOCR.<br />
<br />&nbps;<br />
Let&#8217;s analyze the script line by line. First we need to include library to convert images to PNM (format supported by GOCR). We&#8217;ll use <a href="/php/pure-php-image-library-almost-20-image-formats">Ziin Image Formats</a>:</p>
<pre class="brush: plain;">
include 'zif.php';
include 'zif_one.php';
</pre>
<p>Now we read source PNG image and save as PNM:</p>
<pre class="brush: plain;">
$im = imagecreatefromfile('input.png');
imagepnm($im, 'input2.pnm');
</pre>
<p>Then we call GOCR command-line app to do the hard part- optical character recognition:</p>
<pre class="brush: plain;">
exec('gocr049 input2.pnm', $text);
</pre>
<p>The result is stored in $text as an array so we convert the array to a string- each line separated with &#8216;&lt;br&gt;&#8217;:</p>
<pre class="brush: plain;">
$text = implode('&amp;lt;br&amp;gt;', $text);
</pre>
<p>And finally- we display the result:</p>
<pre class="brush: plain;">
echo $text;
</pre>
<p>Of course the result is almost never perfect and the quality of GOCR output depends on quality of the source image used. The bigger resulution, the less noise- the better recognition. GOCR does support teaching mode so we can use it to improve results- just run GOCR manually with the params:</p>
<pre class="brush: plain;">
gocr049 -m 130 -p ./db/ input2.pnm
</pre>
<p>And when you want to recognize images using database you created when teaching GOCR- use:</p>
<pre class="brush: plain;">
gocr049 -p ./db/ input.pnm
</pre>
<p>/db/ is the path to our GOCR database.<br />
<br />
The whole script:</p>
<pre class="brush: plain;">
include 'zif.php';
include 'zif_one.php';
$im = imagecreatefromfile('input.png');
imagepnm($im, 'input2.pnm');
exec('gocr049 input2.pnm', $text);
$text = implode('&amp;lt;br&amp;gt;', $text);
echo $text;
</pre>
<p>Or same thing zipped with gocr for Windows and test image:<br />

	<div style="text-align:center">
	<a href="/downloads/ocr.zip"><img src="/download.png" src="download" title="Download" style="border:0"></a>
	</div>
	
]]></content:encoded>
			<wfw:commentRss>http://de77.com/php/ocr-optical-character-recognition-in-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pure PHP image library- almost 20 image formats</title>
		<link>http://de77.com/php/pure-php-image-library-almost-20-image-formats</link>
		<comments>http://de77.com/php/pure-php-image-library-almost-20-image-formats#comments</comments>
		<pubDate>Tue, 06 Mar 2012 18:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[pbm]]></category>
		<category><![CDATA[pgm]]></category>
		<category><![CDATA[pnm]]></category>
		<category><![CDATA[ppm]]></category>
		<category><![CDATA[targa]]></category>
		<category><![CDATA[tga]]></category>

		<guid isPermaLink="false">http://de77.com/?p=657</guid>
		<description><![CDATA[This time I want to present, for the first time, a non-free library for loading and saving images. It is not free, but it's quite cheap (19.9 USD) and give you support for almost 20 image formats including tga (targa), ppm (portable pixmap), pgm (portable graymap), pbm (portable bitmap), pfm (portable float map) dds (microsoft's direct draw surface).]]></description>
			<content:encoded><![CDATA[<p>This time I want to present, for the first time, a non-free library for loading and saving images. It is not free, but it&#8217;s quite cheap (19.9 USD) and gives you support for almost 20 image formats including tga (targa), ppm (portable pixmap), pgm (portable graymap), pbm (portable bitmap), pfm (portable float map) dds (microsoft&#8217;s direct draw surface).<br />
<br />&nbsp;<br />
The library does not use any command line applications, does not communicate with any Web APIs. You do not have to recompile your PHP and it works under *nix and Windows- you just need PHP 5 with GD.<br />
<br />&nbsp;<br />
Thanks to this lib you can, for example, convert images to ppm/pgm/pbm and use them with GOCR (a free OCR command-line engine for Windows and Linux) to convert images into text. And how to do this you can read in my other post- <a href="/php/ocr-optical-character-recognition-in-php">here: OCR in PHP</a>.</p>
<p>&nbsp;<br />
<a href="http://ziin.pl/en/scripts/ziin_image_formats_php">You can get Ziin Image Library here</a><br />
&nbsp;<br />&nbsp;&nbsp;<br />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/php/pure-php-image-library-almost-20-image-formats/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Few very useful PHP functions #2</title>
		<link>http://de77.com/php/few-very-useful-php-functions-2</link>
		<comments>http://de77.com/php/few-very-useful-php-functions-2#comments</comments>
		<pubDate>Tue, 06 Mar 2012 17:51:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://de77.com/?p=655</guid>
		<description><![CDATA[In this post I would like to present next set of PHP functions that are not super-advanced, but really handy. You can use them freely as they all are licensed under MIT.
I think you might find them useful too.]]></description>
			<content:encoded><![CDATA[<p>In this post I would like to present next set of PHP functions that are not super-advanced, but really handy. You can use them freely as they all are licensed under MIT.<br />
&nbsp;<br />
I think you might find them useful too. If you do- please leave a comment, thanks!<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<h2>Unique file name</h2>
<p>This function returns numerical name for a file with given extension in a given directory that <b>does not exits</b>. It can be used as a name for temporary files, like uploads and such. If you call it like uniqFile(&#8216;upload&#8217;, &#8216;.jpg&#8217;) it will return something like &#8216;1.jpg&#8217; or &#8216;15523.jpg&#8217;.</p>
<pre class="brush: plain;">
function uniqFile($dir, $ext)
{
	if (substr($dir, -1, 1) != '/')
	{
		$dir .= '/';
	}

	for ($i=1; $i&lt;999999; $i++)
	{
		if (!is_file($dir . $i . $ext))
		{
			return $i . $ext;
		}
	}
	return false;
}
</pre>
<h2>Human size</h2>
<p>This functions returns human-readable size of the file. It&#8217;s only parameter is size in bytes. humanSize(1030) will return &#8216;1 kB&#8217;.</p>
<pre class="brush: plain;">
function humanSize($size)
{
	if ($size &lt; 1024)			return sprintf('%d B', $size);
	if ($size &lt; 1048576)		return sprintf('%.2f kB', $size/1024);
	if ($size &lt; 1073741824)		return sprintf('%.2f MB', $size/1048576);
	if ($size &lt; 1099511627776)	return sprintf('%.2f GB', $size/1073741824);
}
</pre>
<h2>To Title</h2>
<p>Converts letter case of a given string- every word&#8217;s first letter becomes uppercase.</p>
<pre class="brush: plain;">
function toTitle($title)
{
	return ucwords(strtolower($title));
}
</pre>
<h2>Hex to String, String to Hex</h2>
<p>These functions convert given hex string into binary string.</p>
<pre class="brush: plain;">
function hex2str($s)
{
	$s = str_replace(' ', '', $s);
	$len = strlen($s);
	$out = '';
	for ($i=0; $i&lt;$len; $i+=2)
	{
		$out .= chr(hexdec(substr($s, $i, 2)));
	}
	return $out;
}

function str2hex($s)
{
	$len = strlen($s);
	$out = '';
	for ($i=0; $i&lt;$len; $i++)
	{
		$out .= dechex(ord($s[$i])) . ' ';
	}
	return $out;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/php/few-very-useful-php-functions-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache error: .htaccess: Invalid command &#8216;RewriteEngine&#8217;, perhaps misspelled or defined by a module not included in the server configuration</title>
		<link>http://de77.com/other/apache-error-htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-configuration</link>
		<comments>http://de77.com/other/apache-error-htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-configuration#comments</comments>
		<pubDate>Wed, 22 Feb 2012 21:58:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[httpd.conf]]></category>

		<guid isPermaLink="false">http://de77.com/?p=650</guid>
		<description><![CDATA[This time a simple error and simple explanation. I installed a nice WAMP package called WampServer and I got an error on a site that worked fine on other servers. The error I found in the logs was:

.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration]]></description>
			<content:encoded><![CDATA[<p>This time a simple error and simple explanation. I installed a nice WAMP package called WampServer and I got an error on a site that worked fine on other servers. The error I found in the logs was:<br />
<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;</p>
<pre class="brush: plain;">
.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
</pre>
<p>It appeared that module mod_rewrite was not enabled in Apache. After I enabled it- the error was gone and website started working.<br />
To enable the module edit apache&#8217;s httpd.conf file and make sure this line is there uncommented:</p>
<pre class="brush: plain;">
LoadModule rewrite_module modules/mod_rewrite.so
</pre>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/other/apache-error-htaccess-invalid-command-rewriteengine-perhaps-misspelled-or-defined-by-a-module-not-included-in-the-server-configuration/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Warning:  POST Content-Length of 1649460972 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0</title>
		<link>http://de77.com/php/php-warning-post-content-length-of-1649460972-bytes-exceeds-the-limit-of-1073741824-bytes-in-unknown-on-line-0</link>
		<comments>http://de77.com/php/php-warning-post-content-length-of-1649460972-bytes-exceeds-the-limit-of-1073741824-bytes-in-unknown-on-line-0#comments</comments>
		<pubDate>Mon, 06 Feb 2012 20:49:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[post_max_size]]></category>
		<category><![CDATA[upload_max_filesize]]></category>

		<guid isPermaLink="false">http://de77.com/?p=648</guid>
		<description><![CDATA[Recently I wrote an upload script in PHP, set the limits using .htaccess:

php_value upload_max_filesize "1.99G"
php_value post_max_size "1.99G"

and then I got this strange error:

PHP Warning:  POST Content-Length of 1649460972 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0

while trying to upload 1.53 GB file. But why the error said I exceeded 1GB limit?]]></description>
			<content:encoded><![CDATA[<p>Recently I wrote an upload script in PHP, set the limits using .htaccess:</p>
<p>php_value upload_max_filesize &#8220;1.99G&#8221;<br />
php_value post_max_size &#8220;1.99G&#8221;</p>
<p>and then I got this strange error:</p>
<p>PHP Warning:  POST Content-Length of 1649460972 bytes exceeds the limit of 1073741824 bytes in Unknown on line 0</p>
<p>while trying to upload 1.53 GB file. But why the error said I exceeded 1GB limit?<br />
After doing some debugging I found out PHP does not like &#8220;1.99G&#8221; notation. So I changed it to:</p>
<p>php_value upload_max_filesize 2136746229<br />
php_value post_max_size 2136746229</p>
<p>and everything started to work.<br />
And why 1.99G and not 2GB or more? When you set 2GB then 32bit versions of PHP will understand this as a negative number and you won&#8217;t be able to upload anything. That&#8217;s why 1.99GB is a safe choice.</p>
<p>Also- what about memory_limit? I have read it many times on the net that this value should be as big as the upload_max_filesize. Well- it doesn&#8217;t. I have made it equal to 64MB and I can successfully upload even 1.53 GB files.</p>
<p>And if you want to upload files bigger than 2GB then either try 64bit PHP or use CGI/Perl/Python upload script.</p>
]]></content:encoded>
			<wfw:commentRss>http://de77.com/php/php-warning-post-content-length-of-1649460972-bytes-exceeds-the-limit-of-1073741824-bytes-in-unknown-on-line-0/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
