Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: Hardoman on December 23, 2020, 08:02:40 AM

Title: PHP Version Switcher v2 bug in config files
Post by: Hardoman on December 23, 2020, 08:02:40 AM
When going to the section "PHP Version Switcher v2" it shows errors:

Warning: parse_ini_file(/usr/local/cwpsrv/htdocs/resources/conf/el/php_switcher/versions.ini): failed to open stream: No such file or directory in /usr/local/cwpsrv/htdocs/resources/admin/modules/php_switch_v2.php on line 0

Warning: array_keys() expects parameter 1 to be array, boolean given in /usr/local/cwpsrv/htdocs/resources/admin/modules/php_switch_v2.php on line 0

Warning: rsort() expects parameter 1 to be array, null given in /usr/local/cwpsrv/htdocs/resources/admin/modules/php_switch_v2.php on line 0

Warning: Invalid argument supplied for foreach() in /usr/local/cwpsrv/htdocs/resources/admin/modules/php_switch_v2.php on line 0

This is expected because there is no /usr/local/cwpsrv/htdocs/resources/conf/el/ folder exist.
I checked on 2 servers installed at different times: there are only
/usr/local/cwpsrv/htdocs/resources/conf/el7/ and /usr/local/cwpsrv/htdocs/resources/conf/el8/
folders exist.

This is a bug in the CWP code
Title: Re: PHP Version Switcher v2 bug in config files
Post by: Sandeep on December 24, 2020, 06:00:01 AM
you have bug in OS try to send the output of "yum clean all"
Title: Re: PHP Version Switcher v2 bug in config files
Post by: Hardoman on January 12, 2021, 12:33:44 AM
Thank you, looks like my rpmdb broken.
Title: Re: PHP Version Switcher v2 bug in config files
Post by: Hardoman on January 12, 2021, 12:36:28 AM
This fixed the issue for me:
Code: [Select]
rm -f /var/lib/rpm/__db.[0-9][0-9]*
rpm --quiet -qa
rpm --rebuilddb
yum clean all

Hope it helps someone