I was working on a local installation and needed to import all the posts/pages/everything from a current WordPress installation, so I exported the XML file. “But John,” you yell, “why didn’t you just export the database and use that?” Thank you friend for asking the obvious question. Looking back I have no idea. I don’t remember and if I recall correctly it never even crossed my mind.

Instead, I decided to upload a beast of an XML file roughly 6MB. You can stop rolling your eyes at me…I feel it. Anyway, I kept getting an error saying upload_max_filesize in php.ini was blocking my file like a fat guy at the bank because of a 2MB limit.
So I needed to find my php.ini file to make the change. How did I find it? by using <php phpinfo(); > and looking at the location of the php.ini file. If you weren’t aware, phpinfo() gives you all the information about the version of PHP you are running. This is also useful if you have a client that doesn’t know anything about their host. You can run phpinfo() and find out that they are still running PHP 3.4 from yesteryear. An upgrade of PHP will allow you to use new frameworks and current versions of WordPress.
Back to finding the php.ini file. If you are using Windows and XAMPP, your php.ini file is in the PHP directory of XAMPP, so xampp/php/php.ini is the path. If you are on a Mac, “select phpInfo on your start screen of MAMP to see which version is running on your machine” (pulled from here). If you are working with a live server you’ll have to check with your hosting provider on how to upgrade php.ini. It may be easy or it may be tucked away. Each will be different.
Once you know which php.ini file is going to be updated, open it in your favorite text editor (I prefer Sublime Text 2) and find the part that says “upload_max_filesize.” Most likely it will have 2M or 4M set. You can make this as high as you want, so I set it to 40M. Save your file and refresh. Nothing…nothing changed on your phpinfo page.
This is the easiest part of the whole repair. Restart Apache. Now, check it again. Fixed? Hooray! If not, you have bigger issues and I can’t help. I will however list the resources where I was able to come up with my solution.

Stack Overflow
DreamHost discussion
PHP Upload Configuration
The post Fixing upload_max_filesize In php.ini appeared first on John B. Hartley.