brandonk
10-04-2001, 09:01 PM
Hi,
I installed phpSysInfo-1.8 this afternoon on two of my RaQs, the first being a RaQ4i which installed beautifully, and the second being a RaQ3 which didn't go so well.
It was just a simple untar and it worked on the RaQ4i but when calling the script on a RaQ3 I get the following error:
Fatal error: Call to undefined function: sys_chostname() in /home/sites/home/web/phpSysInfo-1.8/includes/class.Linux.inc.php on line 48
Any ideas?!? I'm puzzled, and not a PHP guru...
bombino
10-04-2001, 09:13 PM
I've never used a RaQ, or that script, but I would guess that the RaQ 3 is using a version of PHP that is too old to make use of the sysinfo script. If you can, upgrade PHP on the Raq3 box. :)
Omair Haroon
10-05-2001, 04:54 AM
Which version of php are you using ?
Try using the phpinfo(); function!
- Omair
brandonk
10-05-2001, 01:04 PM
I just upgraded to PHP Version 4.0.6, and I'm still receiving the same error....
Omair Haroon
10-05-2001, 01:18 PM
Try doing the following:
Create a .php page with
<?php
phpinfo();
?>
and save it as info.php and upload it to both RaQ3 and RaQ4 and compare the values. If something does'nt match, then I think that might be the problem. :rolleyes:
Also, why not try any other script like phpSysInfo. I think you can find more like that at http://www.hotscripts.com or http://php.resourceindex.com
brandonk
10-05-2001, 08:48 PM
anyone have anything other then guess and shoot method?
Omair Haroon
10-06-2001, 03:29 AM
Hello brandonk,
I searchd for the error on the Cobalt Mailing List page but could'nt found any pages or anything. This is definitely something new!
Though I would ask one of my friends for solution.
Sorry for passing out those guesses as I thought that might help a little :(
- Omair
iplexx
10-06-2001, 04:55 AM
Hi,
i've got the same problem - it's working on RaQ4 (php 4.0.3) while it's not working on RaQ3 (php 4.0.6)
my first guess was that sys_chostname() is a system function not provided by the old kernel/old apache on raq3, but IMHO it's possible related to the new php.
anyway, it's easy to fix that it's working on raq3:
- edit class.Linux.inc.php in the includes folder
- paste following code at the top of the document:
function chostname()
{
if ($fp = fopen('/proc/sys/kernel/hostname','r')) {
$result = trim(fgets($fp, 4096));
fclose($fp);
$result = gethostbyaddr(gethostbyname($result));
} else {
$result = 'N.A.';
}
return $result;
}
- voila, now it's working on raq3 too :D
brandonk
10-06-2001, 11:15 AM
Awesome! Thanks... that did the trick. Omair, thanks for the effort!
Omair Haroon
10-06-2001, 01:40 PM
No Problem!
by the way, I won't call them efforts instead I would call them throwing arrows in the air ;)
- Omair