0

I posted thread on Ubuntu forums couple of months ago but I never got any responds from them... So today I replied there and posting a new thread here, since I have a feeling I wont get a reply there again...

Here is the thread on board >>

http://ubuntuforums.org/showthread.php?t=2167812


New reply I added today >>

So obviously there is a issue with file size... At least that's what I concluded from my tests... Since I started this thread error persisted, not only on server used in this thread but on last 3-4 servers I used... Just can't fix the damn thing...

No problem uploading 63 kB file... I generated file like this, downloaded and uploaded...

dd if=/dev/zero of=output63.dat bs=63K count=1
1+0 records in
1+0 records out
64512 bytes (65 kB) copied, 0.000119143 s, 541 MB/s

Error when uploading file created with dd, size 65 kB

dd if=/dev/zero of=output.dat bs=65K count=1
1+0 records in
1+0 records out
66560 bytes (67 kB) copied, 0.000133106 s, 500 MB/s

Again error when uploading 64kB file...

dd if=/dev/zero of=output64.png bs=64K count=1
1+0 records in
1+0 records out
65536 bytes (66 kB) copied, 0.000135499 s, 484 MB/s

I used this upload script to test >>

upload.php

Filename:

upload_file.php

0) { echo "Return Code: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB
"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
";

if (file_exists("upload/" . $_FILES["file"]["name"]))
  {
  echo $_FILES["file"]["name"] . " already exists. ";
  }
else
  {
  move_uploaded_file($_FILES["file"]["tmp_name"],
  "upload/" . $_FILES["file"]["name"]);
  echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
  }
}   } else   {   echo "Invalid file";   } ?>

These are my php.ini settings for file sizes and post limits

post_max_size   256M
upload_max_filesize 256M
upload_tmp_dir  no value
memory_limit    1024M

Folder is chmoded to 777 and upload works fine with files less than 64 kB in size...

Lighttpd configuration

server.upload-dirs = ("/var/www/tmp")
server.max-request-size = 2097152
server.network-backend = "writev"

In case there is need for OS info...

cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.3 LTS"
NAME="Ubuntu"
VERSION="12.04.3 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.3 LTS)"
VERSION_ID="12.04"

Damn I have no idea anymore... Anyone? Anything?


Day 2...

I created new VPS with ngnix running on Ubuntu 12.04.3 LTS, different company, ~ same OS, different web server...

Here's the history...

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server php5-mysql
sudo apt-get install nginx
sudo service nginx start
sudo apt-get install php5-fpm
sudo nano /etc/php5/fpm/pool.d/www.conf
sudo service php5-fpm restart
sudo nano /usr/share/nginx/www/info.php
sudo service nginx restart
cd /usr/share/nginx/www/
ls
sudo nano /etc/nginx/sites-available/default -c
sudo service nginx start
mkdir upload
chmod 777 upload
ls
nano upload.php
nano upload_file.php
cd upload
ls
sudo nano /etc/nginx/sites-available/default -c
cd /etc/nginx/
ls
nano nginx.conf
sudo service nginx start
nano /etc/php5/fpm/php.ini
sudo service nginx start
service PHP-FPM restart
service php5-fpm restart
nano /etc/php5/fpm/php.ini
ls
dd if=/dev/zero of=output.dat bs=1M count=1
ls
mv output.dat /usr/share/nginx/www/test.jpg

phpinfo()

memory_limit    128M
post_max_size   256M
upload_max_filesize 256M
upload_tmp_dir  no value

OS info

root@nginx-test:~#  cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.3 LTS"
NAME="Ubuntu"
VERSION="12.04.3 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.3 LTS)"
VERSION_ID="12.04"

Same php upload script... This time uploads up to 1MB if 1MB or more I get 413...

413 Request Entity Too Large

nginx/1.1.19


Day 3

I installed Wordpress 3.8. I am unable to add any media.

http://imgur.com/a/JXkPB

I am receiving HTTP error, 413 when uploading from Upload New Media page.

I tried with disabled plugins, chmoding to 777, 755, 644 /wp-content/uploads folder and all of its sub-directories.

I always end up with 413 :/

Cokaric
  • 21
  • 5
  • Can you narrow this down more to whether this is the webserver or php? Check the full headers returned and the source of the response for some clues. Also make sure you're restarting php and the webservers after making the changes. – Kyle Dec 18 '13 at 18:56
  • I restart web server each time I change anything in any configuration across server. There is nothing in lighttpd error logs or in php error logs I added custom error log in upload_file.php and upload.php ini_set("error_log", "error.log"); to log all logs in case the previous is not working... Again no errors. Produced custom error something like and it got output in error.log file but nothing related to problems I am experiencing... – Cokaric Dec 18 '13 at 19:55

0 Answers0