I keep getting this error when trying to configure the upload directory with Apache 2.2 and PHP 5.3 on CentOS.
In php.ini:
upload_tmp_dir = /var/www/ht
This worked for me.
sudo adduser www-data sudo chown -R www-data:www-data /var/www sudo chmod -R g+rwX /var/www
Then logout or reboot.
If SELinux complains, try the following
SELinux
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www(/.*)?' sudo restorecon -Rv '/var/www(/.*)?'