Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to make available a mp4 video of ~500Mb but my connection is too slow to do this at home.

To achieve this, I uploaded the video via ssh from school then i used the wordpress media manager to upload a mp4 file of 1 byte.

Once this file is uploaded, I went through ssh to its directory then I moved the 500Mb file to replace it.

The problem is after that I get an HTTP 500 error, even if : - both of the original file (1B) and the replacing file (500Mb) are given 644 perms and the same owner/group - I checked that the filename is the same, it can not be an error like this.

Here is my htaccess :

AddType video/mp4 .mp4 .m4v

SetEnv REGISTER_GLOBALS 0
SetEnv ZEND_OPTIMIZER 1
SetEnv MAGIC_QUOTES 0
SetEnv PHP_VER 5

SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/xml application/xhtml+xml text/plain application/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

I can not figure out the problem. Does anyone know ?

I forgot to specify that it is a multisite wordpress.

Thanks a lot !

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The multisite is using

ms-files.php?file=$2

to open uploaded files and at the end of ms-files.php you have

// If we made it this far, just serve the file
readfile( $file );

So opening a 500mb file could be too much for your php process.

You could try to increase the available memory footprint of your php processes.

Or host the file externally or try uploading it to Vimeo/Youtube.

ps: another way is to use the map feature of Nginx to bypass php, but that will not help you since you use Apache. There might be similar methods for Apache, but I'm not sure.

Edit: it looks like there is now a way to turn off ms-files.php according to this ticket:

http://core.trac.wordpress.org/ticket/19235

I found this post describing the steps:

Turn off ms-files.php after network setup

share|improve this answer
    
Thanks a lot ! I didn't know ms-files was working this way. That explains everything. –  Charaf Feb 14 '13 at 17:14
    
So I just have to try to remove it like wp3.5 does. –  Charaf Feb 14 '13 at 17:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.