Forum Moderators: travelin cat

Message Too Old, No Replies

Some strange apache 2 and php combo problems

looks like there is a very short time to activate timeout

         

John_Keates

9:17 pm on Oct 7, 2005 (gmt 0)

10+ Year Member



Simple problem:

I made a photobook in php 5 running with apache 2.
The problem is that if a visitor clicks on a photo to enlage it
(well, to open the image file in real size in a popup)
the image stops loading after being loaded for 1/10
after refreshing it loads 3/10 then after more refreshing it will load the entire photo. Very strange. Looks like the request died or something to me.

the viewer script imgwindow.php:

<?php

//dunno if this header is needed:

header("HTTP/1.1 202 Accepted");

$image = $_GET['img'];
$echo = "Content-type: image";
$imgtype = substr(mime_content_type($image), 5);
header($echo . $imgtype);
echo readfile($_GET['img']);
?>

so if I go to:
[localhost...]

the picture won't load 100% (well my home PowerMac is the server so I can use localhost but then it just works fine... , external clients have problems only)
I know this is not the best way yo make a image viewer window but I only spent 5 seconds on this simple script only to complete my new photo album.

If someone could tell me why big images arent loading
(they even won't if I go to the images directly without any script, but then I had to turn off the sercurity settings in my apache cfg and thats why I use a script to get them)

John

BjarneDM

8:05 pm on Oct 8, 2005 (gmt 0)

10+ Year Member



Could it be this problem you are running into?
[issues.apache.org...]
[golem.ph.utexas.edu...]
[forums.serverlogistics.com...]
[macosxhints.com...]
[toxicsoftware.com...]

The only way to fix it is to build Apache2 yourself!

Actually, there are several problems with Apache2 and Mac OS X:

1)
[nagoya.apache.org...]
[nagoya.apache.org...]
[nagoya.apache.org...]

2)
[mail-archives.apache.org...]

I can send you a *.zip file with the necessary files for compiling Apache2 and installing it in /Libray/Apache2 if you are interested.

John_Keates

8:29 am on Oct 9, 2005 (gmt 0)

10+ Year Member



Well,

I would be intrested if I had a faster server, but I don't have a fast server so compiling could take a long time. Thanks anway.

BjarneDM

9:33 am on Oct 9, 2005 (gmt 0)

10+ Year Member



Compiling Apache takes at most 1 hour on a recent system.

John_Keates

1:57 pm on Oct 9, 2005 (gmt 0)

10+ Year Member



Got a powermac g4 single 400mhz, 1.36gb ram and 160gb hd. Not very recent...

BjarneDM

9:58 pm on Oct 15, 2005 (gmt 0)

10+ Year Member



Apache 2.0.55 fixes all of the issues:
[apache.org...]

So, you'll just have to bugger whoever supplies your Apache install for an updated release.

And by the way: I'm compiling my own versions of the whole suite (Apache, PHP5 MySQL4) on some really old hardware without problems:
PowerBook 3400 (180Mhz, 144MB RAM, 30GB HD)
PowerBook G3 (original) (200MHz, 160MB RAM, 30GB HD)
as well as two TiBooks (800Mhz and 1GHz)

One just has to automate the process

John_Keates

10:30 pm on Oct 15, 2005 (gmt 0)

10+ Year Member



I hope someone will make a binary apache 2.0.55 install for macosx soon...