Author Topic: PHP Version Switcher v2 bug in config files  (Read 3420 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP Version Switcher v2 bug in config files
« 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

Offline
*****
Re: PHP Version Switcher v2 bug in config files
« Reply #1 on: December 24, 2020, 06:00:01 AM »
you have bug in OS try to send the output of "yum clean all"

Offline
*
Re: PHP Version Switcher v2 bug in config files
« Reply #2 on: January 12, 2021, 12:33:44 AM »
Thank you, looks like my rpmdb broken.

Offline
*
Re: PHP Version Switcher v2 bug in config files
« Reply #3 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