Recently I’ve found that some local (XAMPP powered) installations of WordPress 2.7 on Linux and Mac return an odd error when user tries to upload a media by both the flash and the browser uploader.
The error raised is Missing a temporary folder as shown in the picture below:
I’ve not yet dug the problem, anyway it seems related to misconfigured temporary paths in the local environment.
You can easily overcome this problem by editing the php.ini file located in etc/ folder, uncommenting the line upload_tmp_dir (by deleting the semi-colon “;”) and pointing the variable to a folder using an absolute path. In Linux possible steps are:
- open a terminal
- create a temporary folder for all apache tasks in your user folder and grant all right to all users:
mkdir wwwtmp && chmod 0777 wwwtmp
- edit php.ini with your text editor and set the temporary folder (you must switch to root user)
su vim /opt/lampp/etc/php.ini upload_tmp_dir = /home/my_user/wwwtmp/
Remeber to remove preceding “;”
- save the file (in vim type :wq an press enter) and restart xampp
If everything went fine the error won’t be raised anymore.