/tmp folder still not writeable PDOException: SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_e0f_0.MYI' (Errcode: 13): SELECT DISTINCT SUBSTRING_INDEX(source, '/', 1) AS path FROM {url_alias}; Array ( ) in drupal_path_alias_whitelist_rebuild() (line 380 of /var/www/html/includes/path.inc).


After noting report status for updating .htaccess in this tmp folder i found in root directory I then changed permissions to 755 and ownership apache:apache
also tried owner:apache Anyway, when tested and trying to delete content as admin it throws above error.

UPDATE: All of this occurred due to erroneous status report for drupal 7.24 saying needing to add security update to files and tmp folder .htaccess but it is a bogus bug and you need to delete them then run cron will recreate and status report disappears.

SEE http://www.ostraining.com/blog/drupal/drupal-724-tmp-directory/    

problem solved
You need to find the user your server is running with (or the owner of files and folders). If your drupal is working correct besides this error then go to your website root and type ls -l in terminal. It will show you something like this:

-rw-rw-rw-  1 www-data charlie 6604 aug  8 04:04 authorize.php
drwxrwxrwx  3 www-data charlie 4096 nov 12 13:02 cgi-bin
etc.


Here you see the owner (www-data) and the group (charlie). This can be different on your system, but remember which you have for the chown-command below.

Give your /tmp folder the same owner. Go to /admin/config/media/file-system on your site and see the path to your tmp folder. If it starts with a '/' then it's located in the root of your system. If it doesn't start with a '/' then its relative to your website-folder, tmp for example is then really /var/www/httpdocs/tmp.

Then use chown -R www-data:charlie /path/to/tmp and you should be good to go. When you use your systems tempfolder at /tmp you really should create and set a subfolder inside /tmp.