5

I've been on this issue since 1.9.2.1 was released. In 1.9.1 everything worked like a charm. When upgrading to 1.9.2.1, all images in the frontend and backend can't be loaded for some reason. Even if you put in the URL to the image, it doesn't show it.

Been looking online and playing around with new installs and finally ended up installing an shop with the standard demo content. Because that should at least work right...?

Address: http://www.rahsite.nl/winkel/

Note: This is a fresh 1.9.2.1 install with demo content. Nothing is changed what so ever.

My hosting guys point to Magento for this issue (Also because they don't know Magento I assume...).

My question: What can I do to resolve this and where do I start?

  • Small edit: In the backend the images aren't showing either... – R. Hickendorff Sep 10 '15 at 12:31
6

Try This below Solution

Open up the following file:

lib/Varien/File/Uploader.php

Find this line :

chmod($destinationFile, 0640);

Replace it with this line:

chmod($destinationFile, 0777);

5

Thanks for the replies people, but I have the solution.

The new upgrade replaced the .htaccess file in the media folder and the .htaccess file that should have been in the root folder wasn't there anymore. I don't know if other people can use these same files, but in case they can here they are.

Media .htaccess contained the following:

Options All -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php

    RewriteRule .* ../get.php [L]
</IfModule>

And should have been:

Options -Indexes
<IfModule mod_php5.c>
php_flag engine 0
</IfModule>

AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    #Options +FollowSymLinks
    RewriteEngine on

############################################
## never rewrite for existing files
    RewriteCond %{REQUEST_FILENAME} !-f

############################################
## rewrite everything else to index.php

    RewriteRule .* ../get.php [L]
</IfModule>

The Root .htaccess file should be:

 ############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

#    Action php5-cgi /cgi-bin/php5-cgi
#    AddHandler php5-cgi .php

############################################
## GoDaddy specific options

#   Options -MultiViews

## you might also need to add this line to php.ini
##     cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

############################################
## default index file

    DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

#    php_value memory_limit 64M
    php_value memory_limit 256M
    php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

    php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

    php_flag session.auto_start off

############################################
## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

    php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

    php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter on all content
    ###SetOutputFilter DEFLATE
    # Insert filter on selected content types only
    #AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

    # Netscape 4.x has some problems...
    #BrowserMatch ^Mozilla/4 gzip-only-text/html

    # Netscape 4.06-4.08 have some more problems
    #BrowserMatch ^Mozilla/4\.0[678] no-gzip

    # MSIE masquerades as Netscape, but it is fine
    #BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    # Don't compress images
    #SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    # Make sure proxies don't deliver the wrong content
    #Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

    SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    ###Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    #RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

#    RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

    RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

############################################
## redirect for mobile user agents

    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

    AddDefaultCharset Off
    #AddDefaultCharset UTF-8

<IfModule mod_expires.c>

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/css "access 1 month"

ExpiresByType text/html "access 1 month"

ExpiresByType application/pdf "access 1 month"

ExpiresByType text/x-javascript "access 1 month"

ExpiresByType application/x-shockwave-flash "access 1 month"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 1 month"

</IfModule>



AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript


############################################
## By default allow all access

    Order allow,deny
    Allow from all

###########################################
## Deny access to release notes to prevent disclosure of the installed Magento version

    <Files RELEASE_NOTES.txt>
        order allow,deny
        deny from all
    </Files>

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

    #FileETag none
1

If you try to access your image directly, you will notice that your sever is return a "500 Internal Server Error". Therefore you need to check your server error log for further info.

enter image description here

  • I can't find any error log. Time to call the server people again I suppose. – R. Hickendorff Sep 10 '15 at 12:47
1

Most probably, you may have forgot to merge the folders that is available in sample data (media, skin) folder with Magento's default media, skin folder. If you didn't do that, please merge those folders.

If you did that step, then you need to check the permission of media folder. You need to have both read & write (777) permission for this folder. Set that permission to media folder.

Hope this helps.

0
  1. Check if the correct product image is selected from the admin panel for the correct store view. All – base image, small images and thumbnails (in Catalog->Manage Products->Images).

  2. Disable the Magento cache(in System->Cache management) till you get everything working and Flush catalog image Cache.

  3. Change the attributes/permissions of the ‘media’ folder in your root to 755 or 777 recursively for the sub-folders and files. *

  4. During migration/installation through SSH, it’s normal that you make a zip of the media folder/entire magento and unzip it in root. Usually this would be done by a root user or a user other than the ftp user. Then you should change the owner and usergroup of these folders/files recursively. If the owner of an image is root and if we try to access it, it won’t allow it. *

  5. If you use big images, try to increase ‘memory_limit’ parameter in your ‘php.ini’ file. Try to use images of size below 1000px. I don’t think we normally require one more than this. Also check if we can reduce the size of the image in kilobytes. Keep it less than 300kb.

    1. check the media folder permission
  • Thanks for your reaction. I've done all on the list and below are the results. 1. Checked - It's correct. 2. Done - Didn't work. 3. Done - Didn't work. 4. The owner is the same for everything on the FTP. 5. Almost all images are below 300kb. The 3 slide images are 200kb and less. 6. The original permission was 755. Changed it to 777 and back to 755. Didn't work. Any other possibilities? – R. Hickendorff Sep 10 '15 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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