[SOLVED] Multi-site weirdness

Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Sun, 2005-05-22 11:53

I have G2b3 installed on my Win2k3 server as follows:

Code
D:\Websites\Gallery2
First gallery
D:\Galleries
Second gallery
F:\Websites\Galleries\TWOMAS

Using the the test to add a single photo item:

If I add a photo to the first gallery all is well and I can see the thumbnail and full picture.

If I add a photo to the second gallery the entry is created but I cannot see either the thumbnail or the full picture.

The problem occurs with both Internet Explorer and Firefox - broken images. However under Firefox if I view just the image I get a message returned that states "The image xxxxx cannot be displayed, because it contains errors".

I then checked the server and using Filemon checked that all the files accessed by G2 were accessible and I cannot see any sort of permissions problems.

Using "wget" I checked out the data being returned by my webserver. For the image that works I get:

DEBUG output created by Wget 1.9.1 on Windows.

set_sleep_mode(): mode 0x80000001, rc 0x80000000
--13:29:34--  http://gallery2.star-one.co.uk/main.php?g2_view=core:DownloadItem&g2_itemId=1032&g2_serialNumber=2
           => `star-one.txt'
Resolving gallery2.star-one.co.uk... seconds 0.00, 192.168.0.10
Caching gallery2.star-one.co.uk => 192.168.0.10
Connecting to gallery2.star-one.co.uk[192.168.0.10]:80... seconds 0.00, connected.
Created socket 1900.
Releasing 00921A40 (new refcount 1).
---request begin---
GET /main.php?g2_view=core:DownloadItem&g2_itemId=1032&g2_serialNumber=2 HTTP/1.0

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050510 Firefox/1.0.4

Host: gallery2.star-one.co.uk

Accept: */*

Connection: Keep-Alive



---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Connection: close
Date: Sun, 22 May 2005 11:29:36 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/5.0.4
Content-Disposition: inline; filename="itemPath_1116760088.jpg"
Last-Modified: Sun, 22 May 2005 11:08:32 GMT
Content-type: image/jpeg
Content-length: 1689
Expires: Sun, 17 Jan 2038 12:00:00 GMT


Length: 1,689 [image/jpeg]

    0K .                                                     100%   26.60 KB/s

Closing fd 1900
13:29:35 (26.60 KB/s) - `star-one.txt' saved [1689/1689]

For the image that fails I get:

DEBUG output created by Wget 1.9.1 on Windows.

set_sleep_mode(): mode 0x80000001, rc 0x80000000
--13:28:55--  http://twomas.star-one.co.uk/gallery/main.php?g2_view=core:DownloadItem&g2_itemId=377&g2_serialNumber=2
           => `twomas.txt'
Resolving twomas.star-one.co.uk... seconds 0.00, 192.168.0.10
Caching twomas.star-one.co.uk => 192.168.0.10
Connecting to twomas.star-one.co.uk[192.168.0.10]:80... seconds 0.00, connected.
Created socket 1900.
Releasing 00921A58 (new refcount 1).
---request begin---
GET /gallery/main.php?g2_view=core:DownloadItem&g2_itemId=377&g2_serialNumber=2 HTTP/1.0

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050510 Firefox/1.0.4

Host: twomas.star-one.co.uk

Accept: */*

Connection: Keep-Alive



---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Connection: close
Date: Sun, 22 May 2005 11:28:56 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/5.0.4
Content-Disposition: inline; filename="itemPath_1116760156.jpg"
Last-Modified: Sun, 22 May 2005 11:09:25 GMT
Content-type: image/jpeg
Content-length: 1689
Expires: Sun, 17 Jan 2038 12:00:00 GMT



Length: 1,689 [image/jpeg]

    0K .                                                     100%   26.63 KB/s

Closing fd 1900
13:28:56 (26.63 KB/s) - `twomas.txt' saved [1691/1689])

Note that the final lines of each show that two extra bytes were transmitted by the server and on further investigation there appears to be a CR/LF at the start of the failing image. I have attached the two files and checked that the files on the server itself are ok and they are - both are identical without extra CR/LF.

Does anyone have any clues as to why this is happening?

Can someone point me at the code that creates the image returned so I can dig around and see if I can see a problem?

Cheers,
Taomyn

----

Gallery URL (optional): http://gallery2.star-one.co.uk & http://twomas.star-one.co.uk/gallery
Gallery version: G2 B3
Webserver (with version): IIS v6
Datatabase (with version): MySQL v4.1.12
PHP version (eg 4.2.1): v5.0.4
phpinfo URL (optional):
Graphics Toolkit(s): ImageMagick v6.2.0
Operating system: Windows Server 2003 SP1
Web browser/version: IE v6 & Firefox v1.0.4
G1 version (for migration bugs):

AttachmentSize
twomas.txt1.65 KB
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-05-22 12:01

intuition....
perhaps there's a newline in one of config.php files? after the last ?> there should be no newline / space.
and there should be no space/newline between
?>
<?php
in config.php.

 
Taomyn
Taomyn's picture

Joined: 2003-11-11
Posts: 135
Posted: Sun, 2005-05-22 13:20

:o You're a star!

Between the sections in config.php for twomas and star-one, the two galleries, was a CR/LF and deleting it cured the problem. Woo hoo :D

The only thing is that now that I have edited the file under Windows it's been converted to Windows CR/LF format rather than UNIX LF only format.

I don't recall having edited the config.php file manually before I added the second gallery, but it's certainly possible. Perhaps the installer/upgrader needs to take into account that the file could be altered this way, or find another way to store the information - the database perhaps?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-05-22 13:30

the multisite config.php files will disappear next week anyway when we change the whole multisite setup.