Straight out of the box D7:

Seeing the amazing things that can be done with Drupal makes me despair when I struggle to get so many basic things to work.

I can't even get avatars to appear for members, or change the site logo.

When I do, no image appears, and just a link to "member's picture", which doesn't even show up when clicked.

As far as I can see, permissions are ok on the sites/default folder.

What's up? Is there a problem with my installation, or is there yet another configuration to set before this happens?

Comments

albannach’s picture

I'm still stuck and would welcome some help!

williamW’s picture

For setting up avatars go to /admin/config/people/accounts there you should get all the info for the user avatars. Make sure you select a display style for the avatars.

as for the logo go to /admin/appearance/settings then select your theme that you are using at the top right and then you should find a field where you can upload a new logo or favicon for your site. Just make sure you are using the current enabled theme or it wont display.

albannach’s picture

Hi thanks for th ereply. I have all the required settings allowing avatars etc, and have tried ot upload a new logo,. but I still just get an underlined link in lieu of an image.

Is there some permission issue, or some other setting I have missed?

williamW’s picture

/admin/config/media/image-styles/list

just check that your image styles are working, if that doesn't work then i'm afraid i'm out of suggestions to check what could be wrong.
Maybe also just check your host's php extensions and make sure a gd library is enabled. Hope that helps

albannach’s picture

Thanks, I checked the config > Image styles, and all seems to be ok apart from the following message at the top:

This image style is currently being provided by a module. Click the "Override defaults" button to change its settings.

Does it mean a separate module? All that's added is privatemsg and wysiwyg, but this problem existed before any additional mdules were installed.

For a moment when I checked, I got an error message about some error on some.inc file about a /0 error, but it didn't show when I went to check again to copy and paste it.

Anyway, I see the test image on nthe left, but just the outline of a white blank on the RHS, and when I click on either of the links for View Actual Size of Sample Modify image I ust get a 500 Internal Server error.

How do I do the checks you mentioned at the end.

Thanks for trying to help., it's just getting so frustrating that even trival things like this involve so much effort.

albannach’s picture

Anyone have any ideas?

I'm getting so frustrated that I can't get a single image to display.

albannach’s picture

I'll be SO grateful to whoever can resolve this issue for me!

albannach’s picture

Conducting some tests, I can get an image only by linking via Only local images are allowed. tag.

I use the image field to upload an image (a simple small jpg), and it is listed as there when I edit, so it's obvioulsy uploaded, but it doesn't display.

Is there perhaps some option buried deep in the menu system that prevents the display of images as a security measure, perhaps?

Or a path error?

This is the number one issue I have at the moment, and I can't move forward without resolving this. It would kind of defeat the purpose if I have to ftp all my images and link to them - and that means none of my users can upload still.

mjohnq3’s picture

1) Go to Configuration - Status Report (admin/report/status). Scroll to the middle of the page and look to see if the File system is Writable and the GD libraries are installed.

2) Go to Configuration - Media - File system (admin/config/media/file-system). Is the Public file system path set to: sites/default/files?

3) Under Configuration - Media - Image styles (admin/config/media/image-styles), all of the styles listed as Default have been created by installed modules. Three of them, thumbnail, media, large, are part of the Drupal installation. These are used to display images uploaded to nodes in the appropriate places.

4) File system permissions for sites/default/files are generally (agreed to be) supposed to be 755.

5) Go to Structure - Content types - Article - Manage Display (admin/structure/types/manage/article/display). Is the Format for the Image field set to Image? Is some style (large is the default) set for the field?

If all of these things are correct than I'm not really sure what's going on with your image problems. It usually (even for Drupal !) just works.

albannach’s picture

Thanks for your reply! I was really hoping your list would pick out the problem, but I've gone though it twice:

1) seems ok?

File system Writable (public download method) OK
GD library PNG support bundled (2.0.34 compatible) OK
GD library rotate and desaturate effects bundled (2.0.34 compatible) OK
Node Access Permissions Disabled

I rebuilt the last, but it made no difference.

2) sites/default/files - OK

3) the three image styles are present. Only thing is, in the example, no reduced image is present, just an empty square with a link to the image. Another example of the main problem...

4) folder permissions all set at 755

5) confirmed

mjohnq3’s picture

Are you able to create an Image style? If you haven't, try to create one. After you do, is the preview image (right-hand-image) of the style you created visible?

albannach’s picture

I managed to create it, but like the others, there's a blank spot on the right, where the derived image should be, and just the pixel measurements besides the space.

However after the creation, there was an error message at the top as follows:

Style original was created.

Error message
* Warning: Division by zero in theme_image_style_preview() (line 787 of /web1/user30812/website/modules/image/image.admin.inc).
* Warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in theme_image_style_preview() (line 789 of /web1/user30812/website/modules/image/image.admin.inc).

I was playing about with Manage Display in the Article Content Type section, and, instead of setting it to large or whatever, selected original. Briefly I was able to get an image in a preview of a draft article, but it went again and I can't get it back.

I was wondering if it would diplay an original image and if it was only the derivative operations in Image Styles that was causing the problems.

With the default styles, when I click on the links by the black space (either "view actual size", or "view sample image" ), I get 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@localhost 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.
Apache/2.2.3 (CentOS) Server at www.xxxxxxxxx Port 80

mjohnq3’s picture

It looks like this problem has been reported previously with no definite resolution, so far. It appears to be an intermittent problem in a few D7 installations. This issue (http://drupal.org/node/873838) written against Drupal 7 core, by a high-level Drupal contributor, is one early example. I'm going to reference this post in that one.

I'm not sure what you should do to try to solve your problem. I have 6 D7 sites set up (4 locally and 2 live) and I haven't seen this problem at all. Since this is definitely preventing you from any further work on your site, the best thing to do, unfortunately, might be to just start over; re-install Drupal and begin anew. Probably not what you wanted to hear but very likely the quickest way to proceed.

albannach’s picture

Thanks for the reply, I'll digest that report later.

I had seen it before, but wasn't sure if was the same thing initially.

I'm wondering about a fresh install working, as I have Drupal 7 installed on three different sites/servers, and have the same problem on every one.

To reinstall, do I need to backup the MySQL database, or will the entries still be there after reinstallation?

How do I do about a reinstallation - just delete all the D7 files via FTP, reupload the lot and run install.php again?

The fact that the database already had a superuser created won't be a problem, or will the existing database values interfere?

Will existing users and page data remian, or does that get lost in a reinstall?

One of my D7 installations has no content put in by me so far, so I could try with that when I hear back from you.

Thanks again!

Oh, I'll double check later when I'm off my phone here, but I think that report you mentioned said people can access an image via a direct link, whereas I get a page not found with a direct link, even though the file IS there, and there's no permission issue:

http://www.mysite.com/sites/defaults/files/image.jpg

Thinking of the 500 error from the links in Image Styles, I am reminded that when I set up Drupal, I was getting a 500 error until I blanked out two lines of code in the .htaccess file. Could that be part of it? I'll check what I blanked out later (the two lines were advised by my hosting company).

OK, back on my desktop - the lines edited out don't seem to relate to images though. I just wondered because of the 500 error appearing again!

# Follow symbolic links in this directory.
# Options +FollowSymLinks

# Multiviews creates problems with aliased URLs and is not needed for Drupal.
# Options -Multiviews

I just noticed there's another .htaccess created in sites/defaults/files on my server. I wonder if something in that one is causing issues? Or an I on the wrong track and htaccess has nothing to do with image rendering?

mjohnq3’s picture

Wow, it isn't working on three different sites/servers? That would actually make me think that it's server related. Even if there were an intermittent bug in Drupal, what are the chances of it happening on all three installations at the same time.

Perhaps you should post a question concerning the 500 errors that don't seem to be image related. Solving that problem may resolve the image problem too. 500 errors aren't very specific by design, you have to look in the server logs to see what's actually happening. It looks like your hosting company did that. Do you know or can you tell if they're knowledgeable Drupal hosting providers? Many say they are but really aren't.

I would definitely check the .httaccess file. It should be the one that is included with Drupal and located there. I would remove any others that exist unless you know or have been advised that they're required. As far as I can tell the +FollowSymLinks option should be enabled but I don't know if that's causing the image problem. There was mention in one of the posts I saw related to this concerning .httaccess causing problems.

I just saw that this (http://drupal.org/node/873838#comment-4361156) has been reported as having been a fix for this problem, at least it that specific case. Php resource limits can cause weird problems. If you're able to change these values on your servers, you probably should try that too. (Although having said that, I see that my shared hosting provider uses the Php defaults for the most part.)

Have you ever used the Drupal IRC (Internet relay chat) channels? Lots of very knowledgeable people are in them and very willing to help others. Read about them here: http://drupal.org/irc.

I think until you get these server issues resolved re-installing Drupal may not be the best idea.

albannach’s picture

Thanks, I'll have a look at the points you mention when I get home.

So there is only supposed to be a single .htaccess file, in the root folder?

Not sure where the other one came from as it wasn't on my hard drive - it must have been created by Drupal I guess.

albannach’s picture

Hi again,

I checked the extra .htaccess file in the sites/default/files folder, and all it says is:

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

....referencing what I commented out in the main one.

I added a .old extension to disable it and lo and behold images now appear on my site!!!!

Do I need this .htaccess file? If so, can it be ammended to fulfill its purpose yet allow images?

I was able to create a test article, with image present, and members' avatars display. I was even able to change the default theme logo! And the image styles rendering appeared!

Hallelujah! Almost! Not totally solved...

However..... I suddenly noticed that the problem resurfaced - and I noticed that Drupal created a new .htaccess file in that folder after a few minutes! I wondered if it did this off its own bat, or because I tried to alter the theme. So I tried again, changing from default Bartik to default Garland, and everything's still ok.

I went back to Bartik, changed to Firehouse, and my images are still there, but the other major problem I have persists (see below). I tried the colour wheel and no colour scheme, but images still present.

Then .htaccess returned and images went again. So I left it without intervention to see if the "return of .htaccess" was caused by messing about with themses, or just done automatically after a time by Drupal.

It's been 10 mins and counting and it hasn't resturned yet. I'll let you know if it does! If so, what can be done to stop this happening? Maybe comment out the line to it doesn't have an effect, yet Drupal sees it there and doesn't try to recreate it?

ETA: the .htaccess returned. I experimented with commenting out the lines - found I need to comment out both for images to display. So rather than delete it, I have left this edited file there, and we'll see if that stops any further problems!

Now the other image issue - and one still outstanding even after this breakthrough - was themes - I couldn't select any other colours from the colour wheel; indeed selecting other presets from the Settings drop down box only gave white background and no graphics. For some reason the DEFAULT value of each theme gives the right colours, but no deviation works. I checked the permissions of the folders, all seem ok, and there's no errant .htaccess files that might be scuppering things again.

If you have any insight into this, that looks like me all set!

Thanks again for your continued help and interest in my problems, I really do appreciate it!

PS, FYI, Since I've had intermittent success so far, I haven't messed with the memory limits so far.

mjohnq3’s picture

Here's some info on the problem with the .htaccess file in sites/default/files: http://drupal.org/node/431310. It does seem that commenting out those 2 lines solves the problem.

I'm not at all sure what the problem with the color (lol American English) wheel might be. I never use those things!

albannach’s picture

Thanks for that link.

Great that I didn't end up having to reinstall!

Leaving aside the colour wheel, even the other default schemes don't work, Fire whatsitname and so on.

Cluesless why.

It would be nice to have a different design of site!

dquark3’s picture

I had the same problem, with no apparent reason. After much work I have discovered an incompatibility with module "Fast 404", which I have now disabled. I tested all Fast 404 settings and could not resolve this issue short of disabling it.

Suspected reason: image styles (like a thumbnail) are created on the fly, and truly don't exist at the time Fast 404 catches it.

muranod’s picture

3 nights of searching and and I hadn't seen that I had leading slashes in the paths in the admin/config/media/file-system screen, which is what was giving me the drupal//sites/default/files path (double slashes) resulting in broken images. I was getting close to starting over.

The pain of learning! Still worth the effort.

Just to re-iterate what I changed for anyone else having this problem (because it took me about 50 searches before I found your solution here):

/sites/default/files is WRONG and will cause Drupal to look for the image-styles in a folder with a double slash in the path.

sites/default/files is the correct path.

Hope I get to the point where I can help someone as much as you helped me.

Dan