Second time I’ve had to do this, so why not document?
If you are running WordPress on a hosted site with a VM (such as Plesk) you may have difficulty installing new themes as WordPress/PHP wants access to the /tmp directory and you don’t have it.
The error will be something like: SAFE MODE Restriction in effect.
This is good. You don’t want your service provider to disable PHP safe mode, but you do want to install new themes.
So, here’s the trick. Create a directory (I call it wp-tmp) in your WordPress directory, and tell PHP that this should be used as a ‘/tmp’ directory when installing themes.
Let’s say my website is www.webbob.ca (it’s not. Hmm it’s free. Maybe I should get it…). On my hosted site this would make my home directories:
Home: /var/www/vhosts/webbob.ca Web home: /var/www/vhosts/webbpb.ca/httpdocs/ WordPress home: /var/www/vhosts/webbob.ca/httpdocs/wp
Create a folder called wp-tmp and make it world writable (777)
WordPress tmp: /var/www/vhosts/webbob.ca/httpdocs/wp/wp-tmp
Add the following to the wp-config.php file:
define('WP_TEMP_DIR','/var/www/vhosts/webbob.ca/httpdocs/wp/wp-tmp');
You can now install themes!