Fixing /tmp sillyness in WordPress

joho.se @ stockholm.sweden

Check out

Work2Go
WebbPlatsen Webbhotell
avgantivirus.se
junkfood.se
s9y.se
My iStockPhotos

Ads by Google

Top Exits

en.wikipedia.org (235)
www.sevenforums.com (30)
www.joho.se (27)
www.pseudocoder.com (27)
freshmeat.net (19)
Locations of visitors to this page

Feed me

Blog Administration

Friday, November 27. 2009

Fixing /tmp sillyness in WordPress

Computers Something that has annoyed me for quite some time with WordPress is its inability to figure out which temporary path to use when installing new themes and plugins, as well as when you upgrade WordPress itself.

On most servers where I use WordPress, the "global temporary" /tmp is not available, and this is a good thing. Unfortunately, it causes some problems for WordPress since the default tits-up action is to default to /tmp when all else fails. That in itself isn't that big of a problem, but IMHO, there's a more appropriate way of figuring out where to put temporary files: use the configured UPLOAD path. And when I say the "configured UPLOAD path", I mean the one PHP thinks it should be using.

Why is this a good idea? Well.. a) the system administrator has configured it like it is configured for a reason, b) there's a fair chance WordPress can actually write to this directory, and c) it makes WordPress so much more flexible in multi-site environments.

Fortunately, there is a way to get WordPress to habla.

Find and edit your wp-config.php file in the WordPress root. Somewhere (it doesn't matter where, just as long as you put it inside the , put this line:

define ('WP_TEMP_DIR', ini_get ('upload_tmp_dir'));


Save the file and Bob's your uncle.
Posted by joho in Computers at 00:04 | Comments (0) | Trackbacks (0)
Vote for articles fresher than 7 days!
Current karma: -2, 1 vote(s) 1093 hits
Bookmark Fixing /tmp sillyness in WordPress  at del.icio.us Digg Fixing /tmp sillyness in WordPress Bloglines Fixing /tmp sillyness in WordPress Technorati Fixing /tmp sillyness in WordPress Bookmark Fixing /tmp sillyness in WordPress  at blogmarks Bookmark using any bookmark manager! Stumble It!

Comments
Display comments as (Linear | Threaded)

No comments


Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications
 
Submitted comments will be subject to moderation before being displayed.