phpsysinfo / phpsysinfo

phpSysInfo: a customizable PHP script that displays information about your system nicely
http://phpsysinfo.github.io/phpsysinfo
GNU General Public License v2.0
1.39k stars 231 forks source link

AlmaLinux 8.5 have some error #331

Closed wangyu1314 closed 2 years ago

wangyu1314 commented 2 years ago

Hello, there are some errors when I upgrade to 3.4.0 on my AlmaLinux 8.5 server, the following is the error log:

Errors × /sbin/dmidecode - /sys/firmware/dmi/tables/smbios_entry_point: Permission denied /dev/mem: Permission denied Return value: 1

./xml.php on line 39 ./includes/output/class.WebpageXML.inc.php on line 203 in function getJsonString() ./includes/output/class.WebpageXML.inc.php on line 190 in function getXMLString() ./includes/xml/class.XML.inc.php on line 864 in function getXml() ./includes/xml/class.XML.inc.php on line 843 in function _buildXml() ./includes/os/class.OS.inc.php on line 269 in function getSys() ./includes/os/class.OS.inc.php on line 168 in function _dmimeminfo() ./includes/class.CommonFunctions.inc.php on line 753 in function readdmimemdata() ./includes/class.CommonFunctions.inc.php on line 293 in function executeProgram( "dmidecode", " -t 17", "# dmidecode 3.2\nScanning /dev/mem for entry point.", true )

errorHandlerPsi : - PHP throws a error Level : 2 Message : preg_match(): Unknown modifier '9' File : /website/cnprint/p/includes/xml/class.XML.inc.php Line : 226

errorHandlerPsi : - PHP throws a error Level : 2 Message : preg_match(): Unknown modifier '9' File : /website/cnprint/p/includes/xml/class.XML.inc.php Line : 227

namiltd commented 2 years ago

This means that the web server is running as non-root and cannot access these files. If access error try execute first: chmod 4755 /usr/sbin/dmidecode but this method is not recommended for safety reasons! I propose to switch DMIDECODE_ACCESS="data" and generate the file data/dmidecode.tmp via crond, e.g. /5 * root dmidecode -t 17 >/var/www/html/phpsysinfo/data/dmidecode.tmp

wangyu1314 commented 2 years ago

This means that the web server is running as non-root and cannot access these files. If access error try execute first: chmod 4755 /usr/sbin/dmidecode but this method is not recommended for safety reasons! I propose to switch DMIDECODE_ACCESS="data" and generate the file data/dmidecode.tmp via crond, e.g. /5 * root dmidecode -t 17 >/var/www/html/phpsysinfo/data/dmidecode.tmp

Thank you for your guidance. I set it up as you said. The dmidecode module is working fine, but there are still some errors as follows. phpsysinfo has been working stably until version v3.3.4 , never reported an error, and never needed additional settings. I think it should be that v3.4.0 has made some changes, I hope it can be improved in the new version, thank you very much.


Errors × errorHandlerPsi : - PHP throws a error Level : 2 Message : preg_match(): Unknown modifier '9' File : /website/cnprint/p/includes/xml/class.XML.inc.php Line : 226

errorHandlerPsi : - PHP throws a error Level : 2 Message : preg_match(): Unknown modifier '9' File : /website/cnprint/p/includes/xml/class.XML.inc.php Line : 227

namiltd commented 2 years ago

Try unstable version from Github: https://codeload.github.com/phpsysinfo/phpsysinfo/zip/refs/heads/main

wangyu1314 commented 2 years ago

Try unstable version from Github: https://codeload.github.com/phpsysinfo/phpsysinfo/zip/refs/heads/main

Thanks Reply. The unstable version you gave has been used, and the dmidecode module will work without additional modifications. But the PHP error still exists, the same as before.

namiltd commented 2 years ago

What value is displayed in version 3.3.4 in Hardware->Machine ?

wangyu1314 commented 2 years ago

What value is displayed in version 3.3.4 in Hardware->Machine ?

Supermicro X9SCL/X9SCM/X9SCL/X9SCM, BIOS 1.1a 09/28/2011

wangyu1314 commented 2 years ago

Sorry, when I set debug to true, all versions reported dmidecode permission errors, it just didn't throw PHP errors before, so I didn't find it.

namiltd commented 2 years ago

Fixed: https://github.com/phpsysinfo/phpsysinfo/commit/4272201774f0236ab9960fd420dc64d4ed9c054f

wangyu1314 commented 2 years ago

Thank you, the PHP error has been fixed.