Troubles with Drupal, File Uploads, and XAMPP

Posted Aug 14, 2008 // 7 comments
Frank:

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


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

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


; Temporary directory for HTTP uploaded files (will use system default if not specified).
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?

About Frank

Frank Febbraro is the CTO at Phase2. He is primarily interested in software, technology and integrating new techniques and practices with proven methods and approaches. A combination of inherent understanding and real world experience enables ...

more >

Read Frank's Blog

Comments

by Anonymous (not verified) on Wed, 11/12/2008 - 17:59

Thanks this helped a ton!

Thanks this helped a ton!

by Photios Giovanis (not verified) on Fri, 02/13/2009 - 00:39

all files uploaded but no rendering

Hi Frank,

I have a question about using xampp. I installed in and built my website with html, css and php. Works great in Localhost. But when I upload all the files all I see is my nav bar

Here is the code for the index.php file

<?php @ require_once ("menu.php");

?>

<?php @ require_once ("$page.html");

?>

Online, I can see the content of the page variable. But, again, all looks good on localhost.

Thanks for your help and hope all is well!

Photi

by Photios Giovanis (not verified) on Fri, 02/13/2009 - 00:40

all files uploaded but no rendering

Hi Frank,

I have a question about using xampp. I installed in and built my website with html, css and php. Works great in Localhost. But when I upload all the files all I see is my nav bar

Here is the code for the index.php file

<?php @ require_once ("menu.php");

?>

<?php @ require_once ("$page.html");

?>

Online, I can't see the content of the page variable. But, again, all looks good on localhost.

Thanks for your help and hope all is well!

Photi

by Tom (not verified) on Mon, 03/02/2009 - 09:17

thx

Thanks Frank, you have just saved my day!!

Tom at Zevaa.com

by Ben (not verified) on Thu, 06/04/2009 - 02:26

Hah, I just did the same

Hah, I just did the same exact thing, except my client's website is on a shared hosted server so I don't have access to php.ini! Guess I'll have to see where this goes...

by Josh (not verified) on Thu, 12/03/2009 - 21:58

Frank... you are a god.

Frank - Just wanted to say thanks a million for posting this. If only I would have found it 6 hours ago. I too am using XAMPP on a Mac and have been banging my head and Googling like a mad-man trying to find the answer. You should post this over at Drupal somewhere. Anyway, thanks again.

by Raj (not verified) on Tue, 02/23/2010 - 12:29

Problem in uploading the file

Hai I build my website using flash and html is that possible to upload file to web using xampp..plz help me outt

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <strong> <code> <p> <img> <ul> <ol> <li> <h2> <h3> <h4> <b> <u> <i>
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.