Welcome to WebmasterWorld Guest from 54.205.88.118

Forum Moderators: coopster & jatar k

$ FILES only contains 'name'

New SUSE server won't upload files

   
5:04 pm on May 11, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



== System: ==
SUSE LERT 11 SP2 (as an AWS EC2 Instance)
PHP 5.3.8
Apache/2.2.12 (Linux/SUSE)

== Issue: ==
File uploads do not work.

== Sample form: ==
<form enctype="multipart/form-data" method="post" action="page2.php">
<input type="hidden" name="MAX_FILE_SIZE" value="3000" />
<input type="file" name="myfile" />
<input type="submit" />
</form>

== Sample processor: ==
<?php
print_r($_FILES);
?>

== Sample result: ==
Array ( [myfile] => Array ( [name] => test.jpg ) )

== AWS EC2 Firewall Settings: ==
ICMP = allow all ports, all sources
TCP = allow all ports, all sources
UDP = allow all ports, all sources

== PHP.ini Settings: ==
file_uploads = On
max_file_uploads = 20
memory_limit = 128M
post_max_size = 36M
realpath_cache_size = 128k
register_argc_argv = Off
register_globals = Off
safe_mode = Off
upload_max_filesize = 25M
upload_tmp_dir = /tmp (chmod 777 for testing)

This same setup worked fine on GoDaddy shared and "dedicated" (ahem) environments. When we moved to AWS EC2, no more file uploads.

SUSE-related? Setting?

Any help at all would be appreciated.

(The Novell Bugzilla report I discovered via Google is restricted access so I can't view it, and I have found nothing with "PHP upload" in any other open or closed Novell Bugzilla reports.)
8:37 am on May 12, 2012 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



is /tmp the full/absolute path to the upload directory?
4:45 pm on May 12, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In this case, yes. It's the system default.

I have also tried using /path/to/web/directory/tmp set to 777, with the same result.

Note that I am not receiving any PHP errors ... which are unusually absent from the $_FILES array in the sample output, above, and there are no errors being reported in my server logs.

The upload attempts are pretty much silently failing.

FTP uploads are not a problem ... just web form uploads.

Also, please note that this same setup, same form code, same PHP version and same Apache version (but not the SUSE Apache version), was previously working fine on a CentOS 64-bit installation. It had to be moved for other reasons, and the new server is running SUSE, as described above.

Thanks for your question!
10:35 pm on Jun 1, 2012 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Looks like the file is not finishing upload and likely a file system permissions issue. Especially if it worked on another server without issue. Check the configurations again, permissions and use a very small footprint filesize just to be sure you aren't pushing any limitations.
5:22 pm on Jun 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



coopster, I appreciate your back to basics approach. Indeed, my troubleshooting included removal of every possible conflict ... fresh file with a basic form and a <1k upload to a 777 tmp directory ... with the same results. No errors, and no file array beyond the 'name' element.

I would have loved to finish troubleshooting this, but switching to a Ubuntu installation cleared it all up immediately.

Personally, I think it is unlikely that this was a SUSE core issue ... more likely the Apache build for SUSE has an issue with file uploads or there was a problem with the way PHP was interacting with the other actors or something. Regardless, abandoning that platform got us back on track without modification.

Thanks for your thoughts, coopster and phranque.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month