WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Images problems after automatic update to 3.4.1 (13 posts)

  1. rapph
    Member
    Posted 2 years ago #

    I use Hostgator for hosting and they have a Quickinstall feature which automatically updates wordpress and others. This feature recently updated my installation to 3.4.1 on my multisite installation. I have 4 sites in the network, and the update only affected one (thank goodness!). Now one of the sites has broken links for all the pics, including in the medial library, plus it won't upload new pics either. It goes thru the motions but winds up with a broken link. The files are not getting to the right folder. When I look at the url for each broken link, it resolves to public_html/domain.com/files/2012/04/image.jpg. Even new ones I upload currently. The other images are working on the other 3 sites, and they are contained in public_html/wp-content/uploads/files/2012/04 (or other months)/image.jpg

    I have a windows 7 computer. Can anybody advise me on how to fix this? My computer is showing the right date, yet new pics are supposedly sent to month 04 in 2012, and aren't getting there either. I tried to get help from HostGator, but some techs there won't help with WordPress.

    Thanks in advance for any advice I can get on fixing this.

  2. rapph
    Member
    Posted 2 years ago #

    Oddly, in the media section, I can upload a pic, and it gives me a url location of domain.com/files/2012/07/image.jpg. I go there, and the image isn't there. There isn't even a folder there named 07. The interface shows a broken link.

    I found the image in my files in public_html/wp-content/blogs.dir/3/files/2012/07/image.jpg

    So, the interface reports it as residing in a different place than the actual location, yet the edit button finds it in the actual location if you try to edit the image in the media section. If I click to view the pic in the media section, it goes to an attachment page that also has everything but the pic itself. Strange.

    Also, the other sites dashboards have a statement thanking me for upgrading, and saying to click on the link to update the other sites on the network. I'm not going to do that because I'm afraid that it'll screw up those sites too.

    Any help will be greatly appreciated.

  3. Is there a folder named /files/ though?

    See, public_html/wp-content/blogs.dir/3/files/2012/07/image.jpg is the right place for the files, but /files/2012/07/image.jpg is the virtual location. it's not broken when the URLs look like that ;) Weird, but notmal :)

    What's in your .htaccess?

  4. rapph
    Member
    Posted 2 years ago #

    text/x-generic .htaccess
    ASCII text
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    I have a backup of this file from earlier on. Here it is below. Should this backup be applied over the one above?

    text/x-generic .htaccess-bak
    ASCII text
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /wp30net/
    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).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress
  5. Use the backup.

    Please note: WordPress upgrades never touch the .htaccess file. Whatever happened there, it wasn't a core part of WP.

  6. rapph
    Member
    Posted 2 years ago #

    I used the backup but it didn't work. I got this:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@urban-hydro-gardens.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    Apache Server at urbanhydrogreens.com Port 80Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@urban-hydro-gardens.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    Apache Server at urbanhydrogreens.com Port 80

    So then I found another backup and tried that but got the same thing. Problem is, I did something stupid. I didn't back up the existing file first, so not I can't even go back to it. guess I really fouled this up. Any ideas?

  7. rapph
    Member
    Posted 2 years ago #

    I can't imagine what could have caused this. Everything was working perfectly and I got the email from Hostgator saying the automatic backup was going to happen in 3 days unless I cancelled it. Since I'm somewhat of a newbie, I figured the automatic back up was the way to go. If I had it to do over again, I would not have used the automatic backup, and I have turned that off in my cpanel.

  8. rapph
    Member
    Posted 2 years ago #

    So, any ideas on how to get this fixed? Do I need to kill all three other sites and build everything over again? Is there any one out there that can advise me on how to go about trouble shooting this problem?

  9. Please don't bump your posts. This is a volunteer forum, and I happen to be on vacation, checking in when I feel like it :) So a lot less than normal. If this is a huge deal and you need help now, you need to consider hiring someone. Otherwise ask, and be patient.

    The first two links of your htaccess backup file need to be deleted.

    text/x-generic.... and ACSII...

    Delete those.

  10. rapph
    Member
    Posted 2 years ago #

    Thanks for your reply.

    My .htaccess file does not contain those links. It starts with

    # BEGIN WordPress

    and ends with

    # END WordPress

    and it returns Internal Server Error when the longer of the 2 above is used.

    I also noticed an additional .htaccess file here /public_html/wp-content/plugins/participants-database/uploads/.htaccess

    it contains:

    # security settings for uploads directory
    Options -Indexes
    Options -ExecCGI
    AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi

    <Files ^(*.jpeg|*.jpg|*.png|*.gif|*.csv)>
    order deny,allow
    deny from all
    </Files>

    I am appreciating your help.

  11. rapph
    Member
    Posted 2 years ago #

    I am not trying to "bump" my post, but I did some more research on this problem and wanted to report it, so that when you do have time to take a look you will have all the info I know at hand.

    On the primary site of the network all works fine, browser calls the image location (via the right click menu in Firefox browser) as http://urban-hydro-gardens.com/wp-content/uploads/2012/02/solanum-lycopersicum-vl-150x150.jpg

    I find that image at
    /public_html/wp-content/uploads/2012/02/solanum-lycopersicum-vl-150x150.jpg

    I added a pic to a page. it gave it a location of

    "http://urban-hydro-gardens.com/wp-content/uploads/2012/02/broccoli1.jpg">

    I found the file at that exact location in the file manager.
    .........

    On the newest sub site that isn't working (urbanhydrogreens.com) , the page source refers the image as such:
    http://urbanhydrogreens.com/files/2012/04/arugula.jpg

    This directory structure didn't exist in Cpanel file manager. I created it and copied the image file into it. It still didn't display on the page.

    Cpanel file manager finds the file at:
    /public_html/wp-content/blogs.dir/3/files/2012/04/arugula.jpg

    When I add a new pic in urbanhydrogreens.com, the browser reports the pic at:
    http://urbanhydrogreens.com/files/2012/04/WheatGrassRoots.jpg
    Cpanel has the uploaded pic at:
    /public_html/wp-content/blogs.dir/3/files/2012/04/WheatGrassRoots.jpg
    The pic doesn't display
    ...........

    The other subsite is urbanhydrogardens.com. It displays all the pics correctly but if I add a picture to a page, I encounter the same problem as the urbanhydrogreens site for that picture only.On urbanhydrogardens.com, the browser reports the pic at:
    http://urban-hydro-gardens.com/wp-content/uploads/2012/01/GrowBoxinAction.jpg
    I find the pic in cpanel at:
    /public_html/wp-content/uploads/2012/01/GrowBoxinAction.jpg

    I added a pic, and the browser reports it at http://urbanhydrogardens.com/files/2012/03/mizuna-300x201.jpg and cpanel finds it at /public_html/wp-content/blogs.dir/4/files/2012/03/mizuna-300x201.jpg
    The pic doesn't display on the page.

    I have a feeling the update treated my network as though it was a sub directory type multisite, when actually it is a subdomain type multisite. At one time not too long ago I was haveing a problem with pictures on urbanhydrogreens.com. That time, the support tech at Hostgator was very helpful and managed to come to solution. The pics were not uploading and it was not creating the folder to put them into. Unfortunately I didn't save the chat script for that session so I don't remember all the details.

    Nonetheless, the update to 3.4.1 seems to have altered my file structure for urbanhydrogreens.com, and that's why none of the existing pics will display. It didn't alter the file structure for urbanhydrogardens.com, and the existing pictures display but when adding new pics the program seems to want to save the files to a different place than where it reports them to be and so uploading new pics to either of those 2 domains results in broken links rather than displayed pictures. The primary site of the network (urban-hydro-gardens.com) functions perfectly in all manners. I hope that explains the problem well enough for you to get an idea what might have happened, and how to fix it. I hope also that you are enjoying your vacation. I am patiently waiting until you have time to address this. Thanks.

  12. The /files/ location is 100% correct. Don't mess with it. Don't edit it. Don't try to change it. If you don't know how Multisite Works and can edit core code to submit patches, leave it alone. Please.

    No, nothing was 'altered.' You just don't yet understand how it works. Be calm and re-read the documentation. We do explain this.

    I added a pic, and the browser reports it at http://urbanhydrogardens.com/files/2012/03/mizuna-300x201.jpg and cpanel finds it at /public_html/wp-content/blogs.dir/4/files/2012/03/mizuna-300x201.jpg
    The pic doesn't display on the page.

    To explain this you have to read your .htaccess (this is why I keep badgering you about it).

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

    That link says 'Anytime someone goes to /files/2012/03/mizuna-300x201.jpg, run the URL through ms-files.'

    So you will have three working URLs:

    http://urbanhydrogardens.com/files/2012/03/mizuna-300x201.jpg
    http://urbanhydrogardens.com/wp-includes/ms-files.php?file=/2012/03/mizuna-300x201.jpg
    http://urbanhydrogardens.com/wp-content/blogs.dir/4/files/2012/03/mizuna-300x201.jpg

    So I tell you this with sincerity: Your .htaccess is still wrong. And if correcting it breaks your site, then your server's messed up, or the file's more wrong, because I know this code works :)

    Read http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite

    Make your .htaccess only the example in there. See what happens.

  13. rapph
    Member
    Posted 2 years ago #

    Hello Mika. I hope you had (or are having) a nice vacation. I copied the .htaccess file from the example and this fixed the problem as far as I can tell. I haven't spent much time checking everything, but the pics do show. I'll try uploading new pics, and if all is well I will drink to your knowledge and helpfulness, and make a donation to receive your ebook(s). Thanks so much for your help. I don't know why this .htaccess changed, but I'm going to back everything up religiously from now on. Thanks again. Without your help I was about to abandon multisite and install each website in it's own wordpress installation. I'm soooo glad I don't have to go through all of that!

Topic Closed

This topic has been closed to new replies.

About this Topic