Pictures not visible

Aalbe

Joined: 2009-05-12
Posts: 4
Posted: Tue, 2009-05-12 19:50

Dear,

I'm currently installing Gallery V3. I imported images (via upload or from web server). Images are added to the album but I can't see it (like if the path is incorrect). Images and thumbnails are correctly created and present on server (checked by FTP).

It should be an access right problem but can't fix it...

I also have the following error message in apache logs :
[Tue May 12 21:37:59 2009] [crit] [client 81.247.141.185] (13)Permission denied: /path/to/gallery3/var/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://photos.tip4.be/gallery3/index.php/Boursiere.JPG

I added an empty .htaccess file at these place. The error message disappeared but the picture did'not appear. :/

Would you have any idea?

If you need further information, don't hesitate to ask it.

Gallery : http://photos.tip4.be/gallery3

 
lng0004

Joined: 2009-05-13
Posts: 1
Posted: Wed, 2009-05-13 04:02

I have the exact problem.

I must add that it worked right after I uploaded the images. All the thumbnails show up properly. But then I closed the window and loaded the website again and had the problem.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2009-05-16 01:52

@Aalbe: Have you set your permissions such that guests can't view your photos? (Seems like you haven't because I can follow those urls). Check to see if you have any .htaccess files in the gallery3/var/thumbs directory.

I'm curious why urls like this don't work:
http://photos.tip4.be/gallery3/var/thumbs/Mariage%20Laurence%20Thibault%2009-05-09/P1000635.JPG

Seems pretty straightforward. Check the permissions on every file and path there and make sure that the files exist and are readable by the webserver.
---
Gallery 3 problems? Check gallery3/var/logs before you post!
Gallery 3 nightlies: http://www.gallery2.hu/download/Gallery3/gallery3nightly.tar.gz
Gallery 3 subversion: http://codex.gallery2.org/Gallery:Using_Subversion#Quick_Start

 
Aalbe

Joined: 2009-05-12
Posts: 4
Posted: Sun, 2009-05-17 11:27

There is no .htaccess in gallery3/var/thumbs :
server thumbs # ll .htaccess
ls: ne peut accéder .htaccess: Aucun fichier ou répertoire de ce type
server thumbs #

Should I have one?

I made chmod 755 on /var and on content of gallery3/var/thumbs and gallery3/var/resized.

and everything seems to work now ...

But now when I create a new album, access right on gallery3/var/[thumbs|resized]/newalbum are still wrong and I have to set it manually to 755... how could I fix this?

Thank you for your support.

Aalbe

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-05-17 21:38

Ok, it seems like when Gallery3 creates your directories, they start off with the wrong permissions. This probably means that your webserver is set up with a bad umask setting. Try this. Put the following into a PHP file and open it up in a web browser:

<?php printf("Umask: %o", umask()) ?>                     

On my system, I see "Umask: 22" which means my umask is 022 (octal) which converts permissions from 0777 to 0755 leaving new directories still readable by the owner. What's your umask set to?

 
Aalbe

Joined: 2009-05-12
Posts: 4
Posted: Sun, 2009-05-17 22:13

the umask is 33 => which means 744 ?

What should I do?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-05-18 07:00

Hm. Well, for starters you could try talking to your system administrator to see why they have the umask set that way. It's a little bizarre that by default, PHP can't access the directories that it creates. To understand this further, create test.php in your gallery3 dir containing this code:

<pre>
<?php
mkdir("var/foo");
system("whoami");
system("ls -ald var/foo");
?>

Browse to that and let me know what you get out of that.

 
Aalbe

Joined: 2009-05-12
Posts: 4
Posted: Tue, 2009-05-26 19:55

The output is :
user
drwxr--r-- 2 user group 4096 May 26 22:01 var/foo

Actually, I'm root on the machine, so I can modify everything which should be changed... but what? ;)

Sorry for the delay and thank you for your assistance.

Aalbe

 
psch

Joined: 2009-05-27
Posts: 2
Posted: Thu, 2009-05-28 09:10

I have similar problem as above and as bug#307. However, after enabling mod_rewrite in Apache httpd.conf file(just delete the # before "LoadModule rewrite_module modules/mod_rewrite.so"), this problem has been solved. I hope it can help a bit.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2009-05-29 23:53

@Aalbe: It appears that you need to fix this for your Apache2 config. Check out the search results here: http://www.google.com/search?q=apache2+umask

---
Gallery 3 problems? Check gallery3/var/logs before you post!
Gallery 3 latest code: http://github.com/gallery/gallery3/zipball/master
Gallery 3 from git: http://codex.gallery2.org/Gallery:Using_Git

 
wwwworking

Joined: 2010-03-04
Posts: 1
Posted: Thu, 2010-03-04 22:41

I had the same Problem:

The Solution which works for me was:

Put a line with

Quote:
umask(0022);

to config.php