Large File Uploads - Works on Shared, but not on VPS

vps

#1

Hi All,

I’ve got large file uploads working on my shared account just beautifully.

Moved all my code to my new VPS, and adjusted my php upload limits. I changed those like so.

  1. Create /home/webuser/.php/5.3/phprc
  2. Added the following to phprc:
    max_execution_time = 1600
    max_input_time = 1600
    memory_limit = 350M
    post_max_size = 580M
    upload_max_filesize = 550M
    upload_tmp_dir = /home/mywebuser/tmp/

Now, I can successfully upload files 30MB in size. But when I get about 100MB to upload, they start failing to upload. I frequently see errors similar to this in my error_log:
ModSecurity: Input filter: Failed writing 1460 bytes to temporary file

I believe I read somewhere that the tmp directory suhosin uses for uploads is only ~100MB in size.

So, my question is two fold.

  1. What would cause my uploads to not work on the VPS but to work fine on my shared account?

  2. Can anyone help me figure out what suhosin settings I need to modify? Even if I knew what to modify, I have no idea where those files are on my VPS.

Thanks to anyone who can offer some insight!


#2

Upload with what? FTP or a web app like Drupal or WordPress?


#3

Upload via custom PHP.

I’ve gotten it narrowed down to something with mod_security, just not sure what.

I ended up moving my VPS to run nginx instead of apache, and all is well now.


#4

[quote=“tyler, post:1, topic:59907”]But when I get about 100MB to upload, they start failing to upload. I frequently see errors similar to this in my error_log:
ModSecurity: Input filter: Failed writing 1460 bytes to temporary file[/quote]

It’s likely the /tmp/ directory that modsec2 is using is set down around the 100MB mark. You’d need to alter the modsec2.conf file to point SecTmpDir and SecUploadDir somewhere else - such as the upload_tmp_dir location you used in your PHP settings above.