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.38k stars 233 forks source link

phpsysinfo v3.3.4: php error #388

Closed oliaros closed 7 months ago

oliaros commented 7 months ago

Describe the bug I'm running phpsysinfo on a Linux machine. I just updated from php v7.2 to php v8.1. Starting phpsysinfo I get the error msg:

Oh, I'm sorry. Something seems to be wrong. errorHandlerPsi :

PHP throws a error Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389

errorHandlerPsi :

PHP throws a error Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389

To Reproduce Just start phpsysinfo and click on the ERROR sign at the top of the page.

Expected behavior no idea

Screenshots not applicable

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

!! If you have any problems, please set DEBUG to true in phpsysinfo.ini and include any error messages in your bug report / help request !!

errors System informationxx.xx.xx (xx.xx.xx.xx)

Template
Language

System Vital

Canonical Hostname | xx.xx.xx -- | -- Listening IP | xx.xx.xx.xx Kernel Version | 5.15.130-eisfair-1-SMP (SMP) i686 Distro Name | eisfair-1 3.4.3 OS Type | Linux Uptime | 5 hours 17 minutes Last boot | Mon, 25 Sep 2023 04:30:22 GMT Current Users | 4 Load Averages | 3.21 2.84 2.58  1% System Language | English United States Computer (C) Code Page | UTF-8 Processes | 134 (3 running, 92 sleeping, 39 other)

Oh, I'm sorry. Something seems to be wrong.

errorHandlerPsi :

PHP throws a error
Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389

errorHandlerPsi :

PHP throws a error
Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389

find_program("nvme")

program not found on the machine

./xml.php on line 52
./includes/output/class.WebpageXML.inc.php on line 179 in function run()
./includes/xml/class.XML.inc.php on line 799 in function getXml()
./includes/xml/class.XML.inc.php on line 778 in function _buildXml()
./includes/os/class.OS.inc.php on line 280 in function getSys()
./includes/os/class.Linux.inc.php on line 1707 in function build()
./includes/os/class.Linux.inc.php on line 924 in function _nvme()
./includes/class.CommonFunctions.inc.php on line 229 in function executeProgram( "nvme", "list", NULL, true )

errorHandlerPsi :

PHP throws a error
Level : 8 Message : fgets(): Read of 8192 bytes failed with errno=22 Invalid argument File : /var/www/htdocs/phpsysinfo/includes/class.CommonFunctions.inc.php Line : 415

errors System information : eisfair.allerstrasse.de (192.168.0.254) Template Language System Vital Canonical Hostname xx.xx.xx Listening IP xx.xx.xx.xx Kernel Version 5.15.130-eisfair-1-SMP (SMP) i686 Distro Name Icon eisfair-1 3.4.3 OS Type OSIcon Linux Uptime 5 hours 17 minutes Last boot Mon, 25 Sep 2023 04:30:22 GMT Current Users 4 Load Averages 3.21 2.84 2.58 1% System Language English United States Computer (C) Code Page UTF-8 Processes 134 (3 running, 92 sleeping, 39 other) Hardware Information Machine System Name/TR-DLS, BIOS ASUS TR-DLS ACPI BIOS Revision 1006 08/30/2002 Processors Intel(R) Pentium(R) III CPU family 1400MHz CPU Speed: 1.40 GHz Cache Size: 512.00 KiB System Bogomips: 2800 Manufacturer: Intel Load Averages: 2% Intel(R) Pentium(R) III CPU family 1400MHz CPU Speed: 1.40 GHz Cache Size: 512.00 KiB System Bogomips: 2800 Manufacturer: Intel Load Averages: 0% PCI Devices SCSI Devices USB Devices I2C Devices Memory Usage Type Usage Free Used Size Physical Memory 69% 614.86 MiB 1.37 GiB 1.97 GiB Disk Swap 1% 1.99 GiB 12.30 MiB 2.01 GiB Mounted Filesystems Mountpoint Type Partition Usage Free Used Size Totals 89.05% 7.95 GiB 60.96 GiB 72.53 GiB / ext3 /dev/md3 (rw, relatime, errors=remount-ro) 91% (4%) 6.76 GiB 60.91 GiB 71.29 GiB /boot ext2 /dev/md1 (rw, relatime, errors=remount-ro) 94% (1%) 3.95 MiB 53.55 MiB 60.64 MiB /brute_force_blocking tmpfs tmpfs (rw, relatime, size=2048k) 17% (1%) 1.67 MiB 336.00 KiB 2.00 MiB /dev/shm tmpfs tmpfs (rw, nosuid, nodev) 1% (1%) 1007.37 MiB 8.00 KiB 1007.38 MiB /run/user/0 tmpfs tmpfs (rw, nosuid, nodev, relatime, size=206308k, nr_inodes=51577, mode=700) 0% (1%) 201.47 MiB 0 B 201.47 MiB Network Usage Device Received Sent Err/Drop lo 109.31 KiB 109.31 KiB 0/0 127.0.0.1 ::1 enx00e0186daf6a 18.85 MiB (959.60 B/s) 267.18 MiB (913.50 B/s) 0/38551 00-E0-18-6D-AF-6A xx.xx.xx 100Mb/s full Voltage Label Value Min Max VCore 1 (as99127f) 1.44 V 1.38 V 1.52 V VCore 2 (as99127f) 1.46 V 1.38 V 1.52 V +3.3V (as99127f) 3.28 V 3.14 V 3.47 V +5V (as99127f) 4.97 V 4.76 V 5.24 V +12V (as99127f) 11.98 V 10.82 V 13.19 V -12V (as99127f) -12.28 V -10.80 V -13.18 V -5V (as99127f) -5.00 V -4.51 V -5.51 V cpu0_vid (as99127f) 1.45 V Temperature Label Value Limit M/B Temp (as99127f) 39.7 C 40.0 C CPU1 Temp (as99127f) 41.6 C 52.0 C CPU2 Temp (as99127f) 41.0 C 52.0 C Fans Label Value Min fan1 (as99127f) 3901 RPM 2657 RPM fan2 (as99127f) 3835 RPM 2657 RPM Other Label Value beep_enable (as99127f) disabled reload S.M.A.R.T Informations Name Reallocated Sector Ct Temperature Start Stop Count Power On Hours Power Cycle Count Raw Read Error Rate Seek Error Rate Multi Zone Error Rate Current Pending Sector Offline Uncorr. /dev/sda 0 35.0 C 6525 113332 6428 0 0 0 0 0 /dev/sdb 0 32.0 C 6741 114254 6641 0 0 0 0 0 /dev/sdc 0 41.0 C 7194 55471 6909 0 124065919 0 0 reload Process Status Name Status apache2 online brute_force_blocking online exim online hddtemp online hfaxd online inadyn online mini_httpd online minidlnad online motion online nmbd online ntpd online pure-ftpd online rsyncd offline smartd online smbd online sshd online syslogd online twonkymedia online xinetd online Created by [phpSysInfo - 3.3.4](http://phpsysinfo.sourceforge.net/) Oh, I'm sorry. Something seems to be wrong. errorHandlerPsi : PHP throws a error Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389 errorHandlerPsi : PHP throws a error Level : 8192 Message : strlen(): Passing null to parameter #1 ($string) of type string is deprecated File : /var/www/htdocs/phpsysinfo/includes/os/class.Linux.inc.php Line : 389 find_program("nvme") program not found on the machine ./xml.php on line 52 ./includes/output/class.WebpageXML.inc.php on line 179 in function run() ./includes/xml/class.XML.inc.php on line 799 in function getXml() ./includes/xml/class.XML.inc.php on line 778 in function _buildXml() ./includes/os/class.OS.inc.php on line 280 in function getSys() ./includes/os/class.Linux.inc.php on line 1707 in function build() ./includes/os/class.Linux.inc.php on line 924 in function _nvme() ./includes/class.CommonFunctions.inc.php on line 229 in function executeProgram( "nvme", "list", NULL, true ) errorHandlerPsi : PHP throws a error Level : 8 Message : fgets(): Read of 8192 bytes failed with errno=22 Invalid argument File : /var/www/htdocs/phpsysinfo/includes/class.CommonFunctions.inc.php Line : 415
namiltd commented 7 months ago

Already fixed: https://github.com/phpsysinfo/phpsysinfo/commit/a78110cd3b526685e30341f6f02296f23eeaf50a

[includes/os/class.Linux.inc.php](https://github.com/phpsysinfo/phpsysinfo/commit/a78110cd3b526685e30341f6f02296f23eeaf50a#diff-67f09111f47d4ff2b53899f3105e4d5816c6177c347bc98815c74a784a7bd33a)
@@ -743,7 +743,7 @@ protected function _cpuinfo()
                           case 'processor':
                              $proc = $arrBuff1;
                              if (is_numeric($proc)) {
-                                 if (strlen($procname)>0) {
+                                 if (($procname !== null) && (strlen($procname)>0)) {
                                      $dev->setModel($procname);
                                  }
                              } else {

Try versions 3.4.0 or above and preferably the latest version 3.4.3.

oliaros commented 7 months ago

I installed v3.4.3 and everything is fine. Thanks for your support, regards, oliaros