Hello.

i try to upload a image on a Article by imagefield

It can see only when i configure the content type - Image like "original" but if i put thumbnail or another the image disapear.

I view the folders the image styles don't generate the images, also their don't appear on the content

What can i do?

Comments

ytsurk’s picture

probably ..
an issue with rights on that folders .. sites/default/files/*

try chmod

aha - interesting ..

pineiden’s picture

I try whit 755,775 and 777 right on the folders and nothing.

And i change the route on database, and nothing

I think the Image Module didn't work

ytsurk’s picture

how is your img stuff configured (admin/config/media/image-styles) ?
do you use IMCE ?

aha - interesting ..

pineiden’s picture

The styles have default configuration and i'm not using IMCE, i'm using CKFINDER

ytsurk’s picture

hmm

so with the WYSIWYG module ?
i thought you're using an image field with a standart uploader ??

you have any error msg in the reports or in the apache log ?

aha - interesting ..

pineiden’s picture

It's independent because this module, image styles, work with imagefield (filefield).
When i upload a image it work, but don't work the image style convert.
And i give the correct chmod permisions

ytsurk’s picture

image styles module ..,
got your question wrong ..

aha - interesting ..

Joan Santana’s picture

Wich user are you using to try this? I've a similar problem and solution is to give 'Administer image styles' perm

pineiden’s picture

the perms are ok, maybe is the server.
I solved it creating a new text field on i only put images with a defined size

semisse’s picture

Hey guys, I don't know if this helps but I had the same problem and I worked it out with Colorbox. Just create your Image Style and then In Structure > Content Types > Manage Display select in the format Colorbox. Then it's just click on the wheel and set the image style that you created.

Worked for me...

Arkrep’s picture

If anyone is having the same problem on a 1&1 managd hosting packaged add the following line to the top of your .htaccess file in your root drupal install.

AddType x-mapp-php5 .php

Not sure if it would apply to another type of hosting... but maybe worth a try.

smilysarat’s picture

I got the same issue... Everything is working fine in my local when i do this in server i am facing problem with Image Styles.. If we set that original image then only it is displaying images, if i change this to any other style then no image is displaying. I was tried as specified above but no use..
/public_html/sites/default/files/styles.... No styles are there here What should i do now
Please help me

wayne57’s picture

Saw this solution, but still struggling to get it working on my live site too:
http://drupal.stackexchange.com/questions/4220/image-styles-not-generate...

wayne57’s picture

I have tried everything, looked at every post and cannot find a solution.
I can download images in their original form using an image field, but if I have an image style applied it will not show.

If I try to change an image style, then the original image appears on the left but not on the right:
See image
If I click on the image on the right I get:

Forbidden


You don't have permission to access /websites/123reg/LinuxPackage24/60/10/_o/6010.org.uk/public_html/sites/default/files/styles/thumbnail/public/modules/image/sample.png on this server.

Apache Server at 6010.org.uk Port 80

My .htaccess file on the root is:

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Modules|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
 Options -Indexes

# Follow symbolic links in this directory.
 Options +FollowSymLinks


# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php index.html index.htm

# Override PHP settings that cannot be changed at runtime. See
# sites/default/default.settings.php and drupal_initialize_variables() in
# includes/bootstrap.inc for settings that can be changed at runtime.

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # Block access to "hidden" directories whose names begin with a period. This
  # includes directories used by version control systems such as Subversion or
  # Git to store control files. Files whose names begin with a period, as well
  # as the control files used by CVS, are protected by the FilesMatch directive
  # above.
  #
  # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
  # not possible to block access to entire directories from .htaccess, because
  # <DirectoryMatch> is not allowed here.
  #
  # If you do not have mod_rewrite installed, you should remove these
  # directories from your webroot or otherwise protect them from being
  # downloaded.
  RewriteRule "(^|/)\." - [F]

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Pass all requests not referring directly to files in the filesystem to
  # index.php. Clean URLs are handled in drupal_environment_initialize().
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]

  # Rules to correctly serve gzip compressed CSS and JS files.
  # Requires both mod_rewrite and mod_headers to be enabled.
  <IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

The .htaccess in the files folder is:

# From the original .htaccess file, do not remove.
# Follow symbolic links in this directory.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
# Options none
# Options +FollowSymLinks

Could anybody help?
I have tried everything but to no avail.

smilysarat’s picture

If you Give 777 permissions to sites/all/default/files folder then it works fine.. and also check whether your style is created or not in this path sites/all/default/files/styles

wayne57’s picture

I have set the sites/all/default/files to 777 permissions, still not working?

I log onto the site with the url of http://example.org.uk
That opens up the front page of my site. When I start to use some of the site functionality such as to apply an image style, then the url changes to:
http://example.org.uk/websites/123reg/LinuxPackage24/60/10/_o/6010.org.uk/public_html/users/webmaster#overlay=admin/config/media/image-styles/edit/thumbnail.

Not sure where the:
/websites/123reg/LinuxPackage24/60/10/_o/6010.org.uk/public_html
are created?

Has this got something to do with it?
I am not sure what the server is doing to change the url?

Thanks for the suggestion by the way.

VitoV’s picture

i had a same problem, in my case problem was in the .htaccess file in the sites/default/files:
-----------
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks
----------
i commented out 'Options None' and 'Options +FollowSymLinks':
----------
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
# Options None
# Options +FollowSymLinks
-----------
and problem solved!

ghmercado’s picture

# Options +FollowSymLinks - worked for me thanks

luapx’s picture

hi struggling drupaler:
I have same issue, i have a easy solution to fix it, hope it work for you 2
it is 2 steps i did:
1. create "images" folder under the root
2. set the location of "images" folder as "Public file system path "
good luck!

trkest’s picture

I had the same problem where images using new custom image styles could not be created.
In my case /sites/default/files/styles/category-image was set to permissions 640

I created a work around by:
1) changing the permissions to 777
2) opening the folder
3) creating a new sub directory called "public" which is expected. ie /sites/default/files/styles/category-image/public
4) changing the permissions to 777
5) Not clicking "update styles" in drupal again as this resets all sub-folder permissions back to 640.

This has to be done each time you setup a new image style.
Next test is to restrict file permissions to be more secure again.

sksmithson’s picture

I had the same problem and remembered that my hosting company enforces 'Options +SymLinksIfOwnerMatch' in the main htaccess file.

I amended the htaccess file in the files directory in line with the above and it worked.

You'd know if your host enforces Options +SymLinksIfOwnerMatch as your site wouldn't work.

oheso’s picture

With some experimentation, I've found this:

1. Create an .htaccess file in /sites/default/files/styles

2. Set the contents to this:

<Limit GET POST>
order deny,allow
allow from all
</Limit>

Should be fine.

Trendoid’s picture

On IIS7.5 with Helicon Rewrite.

Life saver, thanks!

suit4’s picture

Check RewriteBase in your .htaccess file.

On my installation, it helped setting it to

RewriteBase /

before that, it was commented out.

lemac889’s picture

In my case, the original image was to big over 2000 px or 1Mo for a Jpeg. I set a maximum image size on the image field of the content type and that worked.

bgrobertson’s picture

In my case, all I had to do was change the ownership of the directories under sites/default/files/styles to be www-data instead of the admin user.

sudo chown -R www-data styles/

el-magic’s picture

It resolves the problem for me too.

cthrucode’s picture

Was struggling with this for hours. Good fix.

Thanks.