Uploading large files PHPRC

vps

#1

Hey guys - let me just say off the bat that I am not simply trying to edit the phprc to upload large files. I have already done that. Please see my current phprc setup right now (all folders, php 5.3, 5.4, and 5.5)


upload_max_filesize = 300M
post_max_size = 300M
max_execution_time = 1000
max_input_time = 1000

extension = fileinfo.so


The current PHP settings for the domain I am trying to upload files to are set to PHP 5.4 Fast CGI. WP 4.0.

I am using a plugin called Use Your Drive in Wordpress to allow users to upload large video files. Through that plugin, but ALSO through the regular WP Media upload, a file around 120mb will upload, and but then when it gets almost complete, it won’t finish. It just spins, and then refreshes, and the file is not there. It has nothing to do with the plugin I am using because it happens in the regular media upload as well. Dreamhost, of course, has refused to tell me what the issue is because they don’t support this (as stated in the Wiki). The chat rep told me that there is “another PHP variable” that needs to be updated or changed in order to fix it. Also, some issues are also happening with upload to FTP. Sometimes I will upload files and they won’t upload correctly via FTP.

Can someone please help me understand what I need to change in the PHP settings in order to allow for these large files (some will be upwards of 300mb) to upload successfully?


#2

Tried increasing the memory as well?

memory_limit = 128M


#3

Yes, DH customer support has attached the /tmp folder to the disk in order to remove that memory limit. I think that takes care of that and removes the memory limit entirely. Should I try it in the phprc just to see?

Can that memory limit be set at like 1gb?


#4

That depends… Do you have a DH VPS that has over 1GB of ram? I’d increase it to 100 / 250 and see if it works. Just remember that increasing it too high also allows PHP to use that memory of which increases the VPS’s memory usage. Too much memory usage will be a bad thing.


#5

Yes, it is a VPS. It’s a smaller site with only about 30 users, so we have done fine to this point on about 600MB of RAM with no crashes. Can you clarify what you mean by increasing the limit to 100/250?


#6

memory_limit

eg… if you wish to increase the max allowed memory for the PHP to 100 or 250, use memory_limit 100M or memory_limit 250M or try setting it to memory_limit -1 and upload a file again to see if it’s memory limit related.


#7

I guess I’m still confused as to why this would be an issue if the /tmp folder that is creating the problems is attached to the hard disk of the VPS? My understanding is that that removes the memory limit altogether, correct, since Dreamhost offers unlimited storage space on the hard disk of the VPS?


#8

Because there are multiple issues that all throw the same ‘error’ in WP (and I hate that stupid ‘http error’ on uploads, which this is). The top three:

  1. Running out of room in /tmp
  2. Running out of PHP memory
  3. ImageMagick crashing

Giving you more tmp space does nothing to the PHP memory, it just literally gave you more space for the upload. Running out of PHP memory is what you’re trying to fix in the phprc file and the VPS memory. One of the gotchas with it is that if you give phprc more memory than the VPS is allocated, then it’ll still crash and burn.

FWIW, WordPress itself has issues when processing images with dimensions over 3500x3500px for much the same reasons.


#9

Ok, let me clarify here - I’m uploading videos. All videos. No images. Just videos. One more time. Just videos. I already had DH customer support try to run me through the whole “maybe ImageMagick is crashing.” Nope. Just videos.

The VPS memory is set to about 700mb right now, so I should be clear to increase the PHP memory and see if that does the trick. I guess it isn’t specified right now, so I just add:

memory_limit = 500M

to the phprc maybe, and see if that works?


#10

Even if you drop ImageMagick as a cause (which I agree you should), it’s the same general issue. PHP sucks with large files :frowning: (I mostly mentioned it because someone will want to know it, and I hate being DenverCoder9 when possible).

But… Is any plugin doing any processing on the video? Not Use Your Drive, that doesn’t, but if you have a plugin to do anything weird while uploading, that could be causing the derp here. I think it’s unlikely, but it’s always a possibility.

Try this:

memory_limit = 500M
upload_max_filesize = 300M
post_max_size = 300M
max_execution_time = -1
max_input_time = -1

That gives you more memory plus the timeout is unlimited. Frankly I would never consider the limit on time for -1 as a sane thing, but for the sake of experimentation, let’s try it!


#11

I do not know of any plugins processing any of the files. We are using WPLMS as an LMS, which does give you the ability to have students upload documents to their assignments, but that just uses the WP Media folder to store the uploads, so I don’t think that plugin is processing anything on the uploads.

Dreamhost has finally decided to get an “Admin” working on this. Hector just messaged me back via Support Ticket about an hour ago saying they needed Admin access to WP to test, so cross your fingers. They are telling me they think they can get it worked out by today. We’ll see!


#12

That’s nice. But I think it will take a few days to sort it out. Did they gave any updates so far?


#13

I ended up back on chat with them yesterday. They are basically telling me that it’s one of my plugins. I told them that this same issue happens with another WP site on the same VPS, but they don’t seem to be listening to what I’m trying to say. It’s been a mess to say the least.


#14

bandicoot, which domain? I THINK I saw that ticket floating around yesterday, but I was (and am) stuck a bit in a hell with some weird one-off issues. I can take a look if you’d like.

The only thing I see under your support history for the account you’re logged into here with is a question about why DreamObjects Backup triggers a malware alert. Answer: Because that scanner is a dork and thinks the compressed files MIGHT be bad. They’re not. False alarm that happens a lot on the wporg repo downloads. (One of my other jobs is a volunteer admin at the wporg plugin repo. We get that a lot.)


#15

So they got it figured out. It took 2 weeks and 4 “admins” to figure out that Fast CGI has separate settings for https. I had turned it off for HTTP, but nobody thought to tell me that https has separate FastCGI settings. As soon as he turned that off it stopped the timeouts.


#16

That is a poorly documented ‘feature.’ Dude, I’m sorry :frowning:

I’ll follow up on that to make sure we get it noted in an obvious place for us!