Server problem

Moderators: John, Sharon, Fossil, Lucky Poet, crusty_bint, Jazza, dazza

Server problem

Postby Apollo » Sun Nov 06, 2005 11:54 pm

Got an odd problem trying to serve pics to a gallery.

I installed a small photo gallery script (php) into a site addressed by a full domain served from my hosted web space. The gallery worked fine, generating thumbs and delivering the full size images as expected.

I repeated the exercise for another site I have, however this one differs from the above in that it's a sub-domain on my hosted web space. Other than that, the application and the gallery script are identical.

The problem is that neither the thumbnails nor full size pictures are delivered. I know the script is running, as it generates the thumbnails automatically the first time the page is accessed, and these have been generated when I check by ftp.

From the gallery, the browser reports the image file does not exist or I do not have access rights for the given url. However, if I punch the given url from a new browser tab, the image displays just fine, so is freely accessible.

I've checked ownership and rights on both working and no-working gallery directories by chmod, and both are identical, so I'm stumped.

The sub-domain failure isn't a one off, as I tried the same install in another one, with the same result.

Any clues, as the only difference I can see between the working and non-working gallery is its existence in a full domain and a sub-domain?
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby russ » Mon Nov 07, 2005 12:10 am

You maybe need to create a new database before installing,
User avatar
russ
First Stripe
First Stripe
 
Posts: 62
Joined: Fri Oct 21, 2005 11:45 am

Postby dcvr » Mon Nov 07, 2005 12:19 am

When you say that the images don't display, does the rest of the page or do you get no output at all?

IE, when the PHP script finishes, do you get a web page with an almost-blank space (just an X) where the picture should be? If so, it's worth doing a show source on the results and looking at what appears in the <IMG SRC="Blah"> elements. Once you can see what's going wrong, it's easier to establish why it's going wrong.

If the PHP is producing no output at all (view source results in a blank page in notepad), try adding:

error_reporting(E_ALL);

at the top of the php code to get some meaningful debug info.
User avatar
dcvr
Busy bunny
Busy bunny
 
Posts: 18
Joined: Sat Jul 17, 2004 1:50 pm
Location: Glasgow

Postby Apollo » Mon Nov 07, 2005 4:26 am

Everything is as expected on the page. Text, layout, position, links and controls such as Back, Forward, Last Image etc. are all where they should be. The text link for the thumb appears in place of the missing thumb and goes to the full image, which (like the thumbs) fails to load.

As noted above using the brower 'show source' says the url was not found on the server, but if I manually punch the same url into the browser, the expected image is viewed with no problem, despite having just been reported as 'not found'.

There are no error messages in the server log either, other than 'File does not exist' for the failed image.

(Afraid there's no databases involved. It's all flatfile).
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby AlanM » Mon Nov 07, 2005 8:32 am

For the subdomain are the images referenced relatively or absolutely?

If its relative, try and modify the script so that its an absolute ref

ie
Code: Select all
http://pics.mydomain.com/images/image1.jpg


instead of
Code: Select all
images/image1.jpg



HTH
Alan
User avatar
AlanM
Third Stripe
Third Stripe
 
Posts: 1827
Joined: Wed Sep 07, 2005 8:59 am
Location: Knightswood

Postby Apollo » Thu Nov 10, 2005 12:34 am

Thanks for the thoughts.

I think the ideas along the lines of a pathing problem are probably right, although I can't see how to check. Problem is it's not my own script, it's in perl (not my language), it's originated in German (so comments don't help) and most significantly, the code is part of a larger program that composes the final html on the fly, so it could be a unix path prob as well.

I'll pass the thought on to the writer.
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby AMcD » Thu Nov 10, 2005 7:40 am

If it works when you enter the urls directly, then it sounds like there are some mod_rewrite rules at work or some other script to block hot-linking/serving of images from the server for anything other than the www domain.

Any .htaccess files in the install?
User avatar
AMcD
Third Stripe
Third Stripe
 
Posts: 684
Joined: Tue Mar 02, 2004 9:19 am
Location: Kilmarnock

Postby Apollo » Thu Nov 10, 2005 10:48 am

I had already thought of that, and the site had hot-linking disabled in the past, but I removed this, even though one domain was serving images, while the sub-domain didn't.

It made no difference, I guess since the referring site would always be mine.

To be sure, I also edited out and even removed the .htaccess files, but again, no change.

On the same theme, I installed an independent image gallery, that is supposed to integrate (with some extra php added to the original). However, as with the original 'simple' image delivery code, when the application is called, the browser reports there is no index.cgi file at the file specified, so I still think there's a path issue failing in the code, and the initial part of it is lacking.

Again, this main gallery app works fine when addressed by its full url.

I have posted a note to the developer, but I reckon I'm first to use the code, so might be a while before an answer appears, if at all.
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby AMcD » Thu Nov 10, 2005 12:09 pm

What script is it?
User avatar
AMcD
Third Stripe
Third Stripe
 
Posts: 684
Joined: Tue Mar 02, 2004 9:19 am
Location: Kilmarnock

Postby Apollo » Thu Nov 10, 2005 3:52 pm

It's just a contribution to a bigger project I've been using to play with wikis.

The script is gallery3.php here

You can see a sample of what it does here

Picture #1 Picture #2 etc. should be thumbnails, like this amd the script has generated them on page load, but they just don't show, as doesn't the full size image when you click on the link.

And, if you right click to 'Show image' you get and error, but if you stick the failed url in a fresh browser, up pops the thumbnail.

To recap, both sites use exactly the same source code and versions, but the working one is a full domain, while the failing one is a sub-domain. Other that, I don't have any differences set up between them.

Most frustrating and irritiating :roll:
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby AMcD » Thu Nov 10, 2005 8:07 pm

On looking at the script it appears to be generating thumbnails with src location starting with /http%3A// , which would suggest it's looking for the files from a path relative to the root of the current host.

In another words, it doesn't need the http://www.geewiki.de-soft.co.uk/ for each photo.

The script seems to obtain the path from this server variable $_SERVER['SERVER_NAME'] so it would be worth comparing values on both servers.

A small test file containing the following should tell you all the server variables,
Code: Select all
<?php phpinfo(); ?>
User avatar
AMcD
Third Stripe
Third Stripe
 
Posts: 684
Joined: Tue Mar 02, 2004 9:19 am
Location: Kilmarnock

Postby Apollo » Thu Nov 10, 2005 11:15 pm

Good job the wiki's got a diagnostic mode that lists those for me, or...

Each one give the $_SERVER['SERVER_NAME'] as the expected server. Only difference is the failing one doesn't have www prefix, but I have redirect on so it works without it anyway.

Interestingly, the /http%3A// component is what is fouling up the address, since it isn't being replaced for some reason, which I hadn't noticed as I had looked at the image properties, rather than location, and the beginning of the location address is missing, so that's why it doesn't appear.

Now, if I could work out why it isn't finding something for the /http%3A// I might get somewhere.

Well, long, cold, wet winter evenings need a diversion ::):
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby Apollo » Fri Nov 11, 2005 12:19 pm

Not the subject of the original plea, but suffering the same problem when I tried to embed it, I was able to replace the original path with a custom one for my sites and get a more sophisticated gallery running as in this example.

I'll be having a go at the original one later, as it allows me to add more text to the subject than this gallery does.

Thanks.
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow

Postby Apollo » Fri Nov 11, 2005 4:04 pm

Cracked the other too.

See the fruit at http://www.butewiki.de-soft.co.uk/?n=Bute.ButeGazetteer where VictoriaSt is the simple one, and VictoriaSt Twg is the advanced one.

I replaced the SERVER_NAME entry with a full url to image location, and found that there were two consecutive statements setting the directory after it, and had to disable one, after which the images appeared as expected.

Thanks again.
User avatar
Apollo
Third Stripe
Third Stripe
 
Posts: 2283
Joined: Sun May 09, 2004 10:26 pm
Location: Glasgow


Return to Random Distractions

Who is online

Users browsing this forum: No registered users and 7 guests

cron