Troubles with Drupal, File Uploads, and XAMPP

Ever tear your hair out for hours trying to track down why something is not working, only to find out that it is the simplest thing?

Well, after losing a large chunk of my life that is never to return, I am happy to say that it is solved. While doing some module development on my Mac using xampp, I was running into the problem that file uploads to nodes, either via upload.module or CCK filefield was not working at all. Not in D5, not in D6. Nothing I could do or think of would solve it. Nothing on Google or any other search engine despite my myriad of search terms.

Frank Febbraro, Chief Technology Officer
#Development | Posted

Ever tear your hair out for hours trying to track down why something is not working, only to find out that it is the simplest thing?

Well, after losing a large chunk of my life that is never to return, I am happy to say that it is solved. While doing some module development on my Mac using xampp, I was running into the problem that file uploads to nodes, either via upload.module or CCK filefield was not working at all. Not in D5, not in D6. Nothing I could do or think of would solve it. Nothing on Google or any other search engine despite my myriad of search terms.

After literally hours trying all I could think of, debugging PHP, JavaScript, etc, I finally found out that Irakli was having the same problem and swooped in to the rescue. Turns out that it was a configuration parameter that was left to “default” in php.ini. By default

  1. ; Temporary directory for HTTP uploaded files (will use system default if not specified).
  2. ;upload_tmp_dir =

Was not actually using a valid system default as best we can tell. Simply changing it to

  1. ; Temporary directory for HTTP uploaded files (will use system default if not specified).
  2. upload_tmp_dir = /tmp

fixed all if our upload woes and we were back in business. Now, can I have that last half a day of my life back?

Frank Febbraro

Frank Febbraro

Chief Technology Officer