Results 1 to 2 of 2

Thread: Apache 2.2 on openSuSe 13.1 - upload of files not working

  1. #1

    Default Apache 2.2 on openSuSe 13.1 - upload of files not working

    Hi,

    I just did zypper up on my opensuse and now looks like something is wrong with apache and php. The problem is that uploading of binary files is not working. I created simple html with this:

    <!DOCTYPE html>
    <html>
    <body>


    <form action="upload.php" method="post" enctype="multipart/form-data">
    Select image to upload:
    <input type="file" name="fileToUpload">
    <input type="submit" value="Upload Image" name="submit">
    </form>


    </body>
    </html>

    and a upload.php with this:
    <?php
    print_r($_FILES);
    echo "<br>";
    echo $_FILES["fileToUpload"]["tmp_name"];
    ?>


    If I try to upload only a .txt file, I get this as output:
    Array ( [fileToUpload] => Array ( [name] => skini.txt [type] => text/plain [tmp_name] => /var/tmp/php4lscAl [error] => 0 [size] => 145 ) )
    /var/tmp/php4lscAl

    But when uploading an .jpg file, i get this output:
    Array ( )
    K[2VšÚ)ðK$…Ç?ÂzQEMï£4²?ÿÙÿìDuckydÿáhttp://ns.adobe.com/xap/1.0/8 8 8 © Corbis. All Rights Reserved. Corbis


    access_log for the two mentioned uploads are:
    txt file:

    172.16.1.193 - - [13/Oct/2015:22:47:26 +0200] "POST /testupload/upload.php HTTP/1.1" 200 242 "http://172.16.1.1/testupload/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"

    jpg file:
    172.16.1.193 - - [13/Oct/2015:22:50:17 +0200] "POST /testupload/upload.php HTTP/1.1" 200 4013 "http://172.16.1.1/testupload/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
    172.16.1.193 - - [13/Oct/2015:22:50:17 +0200] "\xff" 400 307 "-" "-"

    another jpg:
    172.16.1.193 - - [13/Oct/2015:22:36:00 +0200] "POST /testupload/upload.php HTTP/1.1" 200 4013 "http://172.16.1.1/testupload/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
    172.16.1.193 - - [13/Oct/2015:22:36:00 +0200] "\xb6\xb1\xd7\x02 \"'o\xa2`\xb7T\\\xe5\x9328\x19\xba\xb7\xaf\xe0\x0fn\xd5\x99^bwoX>\x12}\xe5\x8d\xff-\xf1\x9ae\xa4\xe0\x96m\x98^^sEo \xa6\xaa\xa6T\xb0\xcfn%P\x91\xf2\xd3\x1a\x991\x1c4\xcd\xbe\xec\xbcB\xddEO\x91\xf8\xb4\x8b\xf9\xc7\xfd\xb5G\xf8\x87\x80\x93\xdaXL\x98\xbbx\x94!\x90\\\xa7(\x82\xf8=RkL7\x9d=\xdc\xc6}\xfb\x05\xfd\xfb\xbdEwP\x80\xfb'\xa5\r\x86\xf0\x0e\tH\x17+\x01$E\xb0p\xdb\x01\xfdU8\xfe\xdd_\x1f\x9c\xc5\xcb\xc7\x9c\xf3\xd8M\x8az5\t\x15\x1bLG\x99^m\x97\xe2\x922\xa8\xecR\xe9!dSK\x06@\xd8\x1d3\xecZ\x13y\x95\x1d\xd0\x10\x02\xdc\x90\xd239w5\xd5\xb9\x9c\xaf_4\xb8Y\xc1\xf6\xe7_\x95" 400 307 "-" "-"



    I have wrote this little two scripts because I have noticed a site hosted on my server not uploading files as it should. So I was thinking something was wrong (although, site was working before zypper up, but, better try than just "think"). All was working before zypper up command. What might be wrong in all this? Thanks!

    Gabrijel
    Last edited by morfeus; 13-Oct-2015 at 13:56. Reason: added access_log sample for another jpg

  2. #2

    Thumbs up Re: Apache 2.2 on openSuSe 13.1 - upload of files not working

    Hi,

    I managed to make all work. I have uninstalled apache2-prefork, apache2 and all dependent packets. Then I disabled update repository of 13.1. Deleted all configuration in /etc/apache2 and then reinstalled apache2-prefork, apache2 and mod-php5. Apache was without php so I needed to manually add LoadModule and issue a2enmod php5. Reconfigured everything (not replacing new configuration files with old ones) and that make all work as it is supposed to. If someone shall have similar problem, this might help

    Kind regards,
    Gabrijel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •