Duplicate of original post: https://troubleshoot-coltpython.blogspot.com/2013/11/phpsysinfo-loading-slow-on-raspberrypi.html
Default installation of PhpSysInfo on RaspberryPI takes a long time to load due some missing programs and hardware components.
My system info:
Hardware: RaspberryPI Model B with 512MB RAM OS: Raspbian GNU/Linux 7 Nginx version: 1.2.1-2.2+wheezy1 PHP version: 5.4.4-14+deb7u5 PhpSysInfo version: 3.0.17-1
Enable debug mode in /etc/phpsysinfo/config.php
define('PSI_DEBUG', true);
Open http://yoursitephpsysinfo/xml.php
I found the following errors:
<Error Function="find_program(lsb_release)"> <![CDATA[ program not found on the machine ./xml.php on line 45 ./includes/output/class.WebpageXML.inc.php on line 138 in function run() ./includes/xml/class.XML.inc.php on line 456 in function getXml() ./includes/xml/class.XML.inc.php on line 435 in function _buildXml() ./includes/os/class.OS.inc.php on line 70 in function getSys() ./includes/os/class.Linux.inc.php on line 576 in function build() ./includes/os/class.Linux.inc.php on line 527 in function _distro() ./includes/class.CommonFunctions.inc.php on line 117 in function executeProgram( "lsb_release", "-a 2>/dev/null", "", true ) ]]> </Error> <Error Function="/usr/bin/lspci"> <![CDATA[ pcilib: Cannot open /proc/bus/pci lspci: Cannot find any working access method. Return value: 1 ./xml.php on line 45 ./includes/output/class.WebpageXML.inc.php on line 138 in function run() ./includes/xml/class.XML.inc.php on line 456 in function getXml() ./includes/xml/class.XML.inc.php on line 435 in function _buildXml() ./includes/os/class.OS.inc.php on line 70 in function getSys() ./includes/os/class.Linux.inc.php on line 583 in function build() ./includes/os/class.Linux.inc.php on line 306 in function _pci() ./includes/class.Parser.inc.php on line 36 in function lspci() ./includes/class.CommonFunctions.inc.php on line 142 in function executeProgram( "lspci", "", "", true ) ]]> </Error> <Error Function="find_program(lsscsi)"> <![CDATA[ program not found on the machine ./xml.php on line 45 ./includes/output/class.WebpageXML.inc.php on line 138 in function run() ./includes/xml/class.XML.inc.php on line 456 in function getXml() ./includes/xml/class.XML.inc.php on line 435 in function _buildXml() ./includes/os/class.OS.inc.php on line 70 in function getSys() ./includes/os/class.Linux.inc.php on line 585 in function build() ./includes/os/class.Linux.inc.php on line 367 in function _scsi() ./includes/class.CommonFunctions.inc.php on line 117 in function executeProgram( "lsscsi", "-c", "", true ) ]]> </Error> <Error Function="file_exists(/proc/scsi/scsi)"> <![CDATA[ the file does not exist on your machine ./xml.php on line 45 ./includes/output/class.WebpageXML.inc.php on line 138 in function run() ./includes/xml/class.XML.inc.php on line 456 in function getXml() ./includes/xml/class.XML.inc.php on line 435 in function _buildXml() ./includes/os/class.OS.inc.php on line 70 in function getSys() ./includes/os/class.Linux.inc.php on line 585 in function build() ./includes/os/class.Linux.inc.php on line 367 in function _scsi() ./includes/class.CommonFunctions.inc.php on line 191 in function rfts( "/proc/scsi/scsi", "", 0, 4096, true ) ]]> </Error>
First, third and fourth error are because some programs are not present on the system, let’s install them.
sudo apt-get install lsb-release lsscsi -y
Second error is due missing PCI bus on raspberryPI.
# lspci pcilib: Cannot open /proc/bus/pci lspci: Cannot find any working access method.
We can’t do anything about that but disable that function in PhpSysInfo PHP code. Open the file/your/path/to/phpsyinfo/includes/class.Parser.inc.php and find the lspci function.
/** * parsing the output of lspci command * * @return Array */ public static function lspci() { $arrResults = array(); if (CommonFunctions::executeProgram("lspci", "", $strBuf, PSI_DEBUG)) { $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY); foreach ($arrLines as $strLine) { list($strAddr, $strName) = preg_split('/ /', trim($strLine), 2); $strName = preg_replace('/\(.*\)/', '', $strName); $dev = new HWDevice(); $dev->setName($strName); $arrResults[] = $dev; } } return $arrResults; }
Change the code above to match the one bellow:
/**
* parsing the output of lspci command
*
* @return Array
*/
public static function lspci()
{
return array();
$arrResults = array();
if (CommonFunctions::executeProgram("lspci", "", $strBuf, PSI_DEBUG)) {
$arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($arrLines as $strLine) {
list($strAddr, $strName) = preg_split('/ /', trim($strLine), 2);
$strName = preg_replace('/\(.*\)/', '', $strName);
$dev = new HWDevice();
$dev->setName($strName);
$arrResults[] = $dev;
}
}
return $arrResults;
}
Disable debug mode in phpsysinfo config, save, reload, drink beer.