[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Required, PHP 4.1.1 or 4.0.6 pkg, anyone have it?
- Subject: Re: [cobalt-users] Required, PHP 4.1.1 or 4.0.6 pkg, anyone have it?
- From: "Paul Mullett" <paul.mullett@xxxxxxxxxxxxxxxxxx>
- Date: Sun Mar 10 19:48:01 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
----- Original Message -----
From: "Per Magne Knutsen" <per.knutsen@xxxxxxxxxxxxxx>
To: <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Monday, March 11, 2002 9:51 AM
Subject: Re: [cobalt-users] Required, PHP 4.1.1 or 4.0.6 pkg, anyone have
it?
> >Does anyone have for the Raq4 an old PKG for PHP 4.1.1 or PHP 4.0.6, that
> >you could either email to me, or point me to on the net. I urgently
require
> >these to try and bug fix some problems I am having with PHP 4.1.2 and I
> >don't have any of the old packages on my local machine.
>
> It is also very easy to compile from source. Search the archives for
instructions. Its just a matter of
>
> - download
> - untar/gunzip
> - configure (with the options you need)
> - make
> - make install
>
> Maybe if you describe your problem in detail, someone here can point out a
solution for your problem in
> specific.
>
>
> Per Magne Knutsen
>
Hi,
Thanks, I have tried asking but no-one has come up with an answer so far!
Before the upgrade to PHP4.1.2 the PHP mail() function worked EXACTLY as it
should. Now it takes FOREVER to send the mail, for example, as an extremely
basic example of the mail function going slow, this simple script:
<?
mail("paul.mullett@xxxxxxxxxxxxxxxxxx", "Test subject", "Test message");
print "finished!";
?>
Which can be found at http://www.clicktolearn.co.uk/test/mail.php in action,
ran (as it should do) extremely fast the week before I made the upgrade from
the packages. Now, as you will see, it runs dog slow.
I have sent mail using send mail from the command line, and it works 100%
fine, so I know it is not a DNS/sendmail problem. This script was working
on the server BEFORE the upgrade for several months.
The second problem (not AS important, but still frustrating) is that the
getenv() function is not returning header values as it should (and did
before the upgrade):
The following script shows the lack of headers:
http://www.clicktolearn.co.uk/test/ (click the link, so there's a referrer
to the script page)...
<?
function get_http_headers($url, $proto="HTTP/1.0", $timeout=10) {
$return = false;
if (substr($url,0,7)=="http://") {
$url = substr($url,7);
}
$parts = parse_url("http://".$url);
$ips = gethostbynamel($parts["host"]);
if ($ips[0]) {
$ip = $ips[0];
$host = $parts["host"];
$path = ($parts["path"]) ? $parts["path"] : "/";
$port = ($parts["port"]) ? $parts["port"] : 80;
$start = time();
$timeout = $timeout + $start;
if($sock = fsockopen($host, $port)) {
set_socket_blocking($sock, 0);
switch($proto) {
case "HTTP/1.1":
set_socket_blocking($sock, 1);
fputs($sock, sprintf("HEAD %s %s\n",
$path, $proto));
fputs($sock, sprintf("Host: %s\n\n",
$host));
break;
default:
fputs($sock, sprintf("HEAD %s
%s\n\n", $path, $proto));
}
while(!feof($sock) && $t<$timeout) {
$line .= fgets($sock,1);
$t = time();
}
fclose($sock);
$end = time();
if ($t>=$timeout) {
$http = parse_output($line);
$http["result"] = 502;
$http["message"] = "Timed Out";
$http["time_used"] = $end - $start;
$return = $http;
} elseif($line) {
$http = parse_output($line);
$http["time_used"] = $end - $start;
$return = $http;
}
}
}
return $return;
}
function parse_output($line) {
$lines = explode("\n", $line);
if(substr($lines[0],0,4)=="HTTP") {
list($http["protocol"], $http["result"], $http["message"]) =
split("[[:space:]]+",$lines[0],3);
} else if(substr($lines[0],0,7)=="Server:") {
$http["server"] = substr($lines[0],8);
}
for ($i=1; $i<count($lines); $i++) {
list($key, $val) = split(":[[:space:]]*", $lines[$i],2);
$key = strtolower(trim($key));
if ($key) {
$http[$key] = trim($val);
} else {
break;
}
}
return($http);
};
var_dump(getallheaders());
print "<br><br>";
var_dump(get_http_headers('http://www.clicktolearn.co.uk/test/testheaders.ph
p'));
print "<br><br>";
print $HTTP_REFERER;
print "<br><br>";
print "<a href='Javascript: history.back();'>Back</a>";
print "<br><br>";
var_dump(getenv($HTTP_REFERER));
?>
You can see the $HTTP_REFERER variable shows, but getenv($HTTP_REFERER) (and
all the other getenv() variables I have tried in other scripts) are empty.
All the track_vars etc. are set to on in the PHP.INI file.
Under the "Back" link is the output of: var_dump(getenv($HTTP_REFERER)); Now
I know that this was working before the upgrade, as a log in script I use on
the main site uses getenv($HTTP_REFERER) to send them back to where they
came from. This again worked 100% fine before upgrading the OS and PHP.
If anyone can shed any light (which I doubt with the lack of replies before)
I would be most grateful, but as I can switch uploads off anyway, PHP 4.1.1
(which was fine) as a pkg would be most useful so I can get the site(s)
using PHP back to full speed! (Or yes, I can compile from source, but a pkg
is quicker and there must be someone who either has one they can send or
knows of one online). :)
Thanks.
Paul Mullett