Home About the Book About the Authors Handy Links

Mac OS X and the php.ini upload limit

Miraz.

Finding and fixing php.ini upload limits on Mac OS X.

Last night I was messing round exporting a WordPress blog and importing it into WordPress on my own Mac so I can play around with the design.

The MacTips blog I exported has almost 900 posts (ie 900 Tips). The downloaded file was 2.1Mb. That’s not particularly large, but it was enough to cause a problem when I tried to import it into the blog I’d set up on my Mac.

Maria Langer and I wrote in Chapter 10 of WordPress 2 Visual Quickstart Guide about exporting and importing between blogs.

When I came to import that 2.1Mb file I received an error message: The uploaded file exceeds the upload_max_filesize directive in php.ini. That upload limit is set at 2Mb, so I needed to change it.

It seemed obvious that the file php.ini was the one to edit, but where and how? Some Googling brought me to Enabling PHP and Apache in Leopard by David Powers.

First I had to create php.ini by copying another file, then it was a simple matter to locate the 2Mb limit and change it. I changed it to 8Mb.

David’s instructions are clear and easy to follow. You need a decent text editor such as TextWrangler (free) or BBEdit, and to paste in a few lines of code in the Terminal.

After amending the upload limit I went to the Sharing System Preference, turned Web Sharing off and then on again. That done, the import went smoothly. Now I can experiment with blog designs, with real content, but without disrupting the public blog.

Save This Page at Delicious