• Resolved jprovost

    (@jprovost)


    Some images on my sites (WPMU) fail to load, showing question marks or X depending on browser. Viewing the images directly via their URL works. Refreshing the page again loads random images, breaking some that worked, loading others that didn’t.

    Error Console in Safari shows a 500 Internal Server Error. The server error log shows (for example):
    [Thu Jan 12 11:15:03 2012] [error] [client 24.150.211.28] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/jprovost/public_html/wp-includes/ms-files.php, referer: http://jamesprovost.com/infographics/
    [Thu Jan 12 11:15:02 2012] [error] [client 24.150.211.28] (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for /home/jprovost/public_html/index.php, referer: http://jamesprovost.com/infographics/

    I contacted my host and they said nothing is wrong on their end, and that it looks like a permissions issue.

    I have since installed WP Super Cache to hopefully alleviate the memory allocation errors.

    I recently transferred some domains from godaddy to namecheap, but I don’t think that’s the issue because one domain didn’t change registrars but is affected.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jprovost

    (@jprovost)

    Update: It seems that ms-files.php was hanging, delivering incomplete file headers, and using up all of my shared hosting resources.

    The following .htaccess rules resolved my problem. They seem to bypass ms-files.php completely, instead redirecting requests from domain.tld/files/ to domain.tld/wp-content/blogs.dir/#/files/

    RewriteCond %{HTTP_HOST} ^domain\.tld$ [NC]
    RewriteRule ^files/(.+) wp-content/blogs.dir/#/files/$1 [L]

    Be sure to replace domain.tld AND the # with the blog id number.

    Thread Starter jprovost

    (@jprovost)

    For the benefit of anyone who finds their way here, this is what my .htaccess at /www/ looks like:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    # RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2&path=$1 [L]
    
    #domain1
    RewriteCond %{HTTP_HOST} ^domain1.com\.com$ [NC]
    RewriteRule ^files/(.+) wp-content/blogs.dir/1/files/$1 [L]
    
    #domain2
    RewriteCond %{HTTP_HOST} ^domain2\.org$ [NC]
    RewriteRule ^files/(.+) wp-content/blogs.dir/5/files/$1 [L]
    
    #domain3
    RewriteCond %{HTTP_HOST} ^domain3\.ca$ [NC]
    RewriteRule ^files/(.+) wp-content/blogs.dir/8/files/$1 [L]
    
    #domain4
    RewriteCond %{HTTP_HOST} ^domain4\.com$ [NC]
    RewriteRule ^files/(.+) wp-content/blogs.dir/14/files/$1 [L]
    
    #...the rest of the rename rules follow this.

    Supercache also greatly reduced my server memory and CPU usage.

    Thread Starter jprovost

    (@jprovost)

    Further to all this, I’ve since reinstalled WordPress to try and address another problem and it has solved this one. The new .htaccess is working fine so far.

    I’m having the same problem you had. My site is using a huge amount of physical memory, and images are not loading properly.

    I’m currently using the WP Super Cache plugin, but it does not appear to be helping.

    I have upgraded to wordpress 3.5 and updated all of my plugins, but to no avail. I’m not very comfortable messing with my htaccess file, but I ‘m not sure what else to do. Was hoping you might have some other ideas on how I can solve this issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Random Images Don't Load’ is closed to new replies.