<?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>Eddie On Everything &#187; filesize</title>
	<atom:link href="http://www.eddieoneverything.com/tag/filesize/feed" rel="self" type="application/rss+xml" />
	<link>http://www.eddieoneverything.com</link>
	<description>Don&#039;t get me started</description>
	<lastBuildDate>Mon, 23 Aug 2010 16:19:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Uploading Large Files to a LAMP setup &#8211; upload_max_filesize, post_max_size, and max_allowed_packet</title>
		<link>http://www.eddieoneverything.com/linux/uploading-large-files-to-a-lamp-setup-upload_max_filesize-post_max_size-and-max_allowed_packet.php</link>
		<comments>http://www.eddieoneverything.com/linux/uploading-large-files-to-a-lamp-setup-upload_max_filesize-post_max_size-and-max_allowed_packet.php#comments</comments>
		<pubDate>Fri, 28 Dec 2007 16:57:02 +0000</pubDate>
		<dc:creator>eddie</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[filesize]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[L.A.M.P.]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[max_allowed_packet]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqld]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[post_max_size]]></category>
		<category><![CDATA[uploading files]]></category>
		<category><![CDATA[upload_max_filesize]]></category>

		<guid isPermaLink="false">http://www.eddieoneverything.com/linux/uploading-large-files-to-a-lamp-setup-upload_max_filesize-post_max_size-and-max_allowed_packet.php</guid>
		<description><![CDATA[So you&#8217;re trying to upload a large file via PHP and you&#8217;re getting an error, eh?  It&#8217;s probably because of PHP&#8217;s default configuration, which limits uploads to 2 Megs, or because of MySQL&#8217;s default 1.5 Meg limitation.  Here&#8217;s how you change these defaults.
First, find your php.ini file.  If you don&#8217;t know where [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense--><br />
So you&#8217;re trying to upload a large file via PHP and you&#8217;re getting an error, eh?  It&#8217;s probably because of PHP&#8217;s default configuration, which limits uploads to 2 Megs, or because of MySQL&#8217;s default 1.5 Meg limitation.  Here&#8217;s how you change these defaults.</p>
<p>First, find your php.ini file.  If you don&#8217;t know where it is, create a php file on your server that contains only the following:</p>
<p><code>&lt;? phpinfo(); ?&gt;</code></p>
<p>Load that up in your browser and look for the line that says<br />
<code>Configuration File (php.ini) Path</code></p>
<p>It&#8217;s probably set to something like /usr/local/lib/php.ini.</p>
<p>Once found, open up this file and edit the following lines as you see fit:<br />
<code>file_uploads = On<br />
upload_max_filesize = 30M<br />
post_max_size = 30M</code></p>
<p>In the above example, I&#8217;ve updated my configuration to allow uploads of up to 30 Megs.</p>
<p>Once this is complete, restart apache (using something like &#8220;/etc/init.d/httpd restart&#8221;) and voila, the file upload size limitation should be lifted.</p>
<p>If you&#8217;re trying to insert this large uploaded file into a MySQL database, you may, at this time, run into a second limitation:</p>
<blockquote><p>An error has occured uploading that fileGot a packet bigger than &#8216;max_allowed_packet&#8217; bytes<br />
SQL: INSERT INTO &#8230;</p></blockquote>
<p>That&#8217;s because mysql also has a limit on how large a single SQL query can be.  This, too, can be raised &#8211; I edited my mysql configuration file at /etc/my.cnf and changed the max_allowed_packet size to 30M as well:</p>
<p><code>max_allowed_packet = 30M</code></p>
<p>After doing so, simply restart mysql using something like &#8220;/etc/init.d/mysql restart&#8221; and the problem should disappear.<br />
<!--adsense#468banner--></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.eddieoneverything.com/articles/how-to-make-phpbb3-forum-links-automatically-relnofollow.php" title="How to Make phpbb3 Forum Links Automatically rel=&#8221;nofollow&#8221;">How to Make phpbb3 Forum Links Automatically rel=&#8221;nofollow&#8221;</a></li><li><a href="http://www.eddieoneverything.com/linux/how-to-keep-an-ssh-connection-alive-in-linux.php" title="How To Keep An SSH Connection Alive in Linux">How To Keep An SSH Connection Alive in Linux</a></li><li><a href="http://www.eddieoneverything.com/programming/mysql-performance-tip-on-duplicate-key-is-faster-than-insert-ignore-but-failing-with-a-duplicate-key-error-is-a-lot-faster.php" title="MySQL Performance Tip:  ON DUPLICATE KEY is faster than INSERT IGNORE, but failing with a duplicate key error is a lot faster">MySQL Performance Tip:  ON DUPLICATE KEY is faster than INSERT IGNORE, but failing with a duplicate key error is a lot faster</a></li><li><a href="http://www.eddieoneverything.com/programming/getting-phps-print_r-function-to-return-a-string.php" title="Getting PHP&#8217;s print_r Function To Return A String">Getting PHP&#8217;s print_r Function To Return A String</a></li><li><a href="http://www.eddieoneverything.com/articles/optimizing-the-google-syntax-highlighter-wordpress-plugin-even-further.php" title="Optimizing the Google Syntax Highlighter Wordpress Plugin Even Further">Optimizing the Google Syntax Highlighter Wordpress Plugin Even Further</a></li><li><a href="http://www.eddieoneverything.com/windows-xp/fix-the-synergy-copy-and-paste-clipboard-problem-on-xp.php" title="Fix the Synergy Copy-and-Paste Clipboard Problem on XP">Fix the Synergy Copy-and-Paste Clipboard Problem on XP</a></li><li><a href="http://www.eddieoneverything.com/linux/rotating-backup-directories-using-cp-al-hardlinks-to-save-disk-space.php" title="Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space">Rotating Backup Directories using cp -al (hardlinks) to Save Disk Space</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.eddieoneverything.com/linux/uploading-large-files-to-a-lamp-setup-upload_max_filesize-post_max_size-and-max_allowed_packet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
