Changing PHP version to 7.4 or 8.2 not working on fresh install

Hi all,

Server version: Ubuntu 22.04.3 LTS
CyberPanel Version:

Current Version:  2.3
Build:  4
Current Commit:  c8da443334b8815ec250a0fba606e75355f641cd
Latest Version:  2.3
Latest Build:  4
Latest Commit:  c8da443334b8815ec250a0fba606e75355f641cd

I’m experiencing problems switching between some versions of PHP, specifically 7.4 and 8.2 (between 8.0 and 8.1 there are no problems).

no error log when downgrading from 8.0 to 7.4 (no changes in php version)

error log upgrading from 7.4 to 8.0:

2023-12-11 13:35:32.186581 [ERROR] [19428] [T0] [config:scripthandler] use static file handler for suffix [php71]
2023-12-11 13:35:32.186584 [ERROR] [19428] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp72.
2023-12-11 13:35:32.186586 [ERROR] [19428] [T0] [config:scripthandler] Can not find External Application: lsphp72, type: lsapi
2023-12-11 13:35:32.186588 [ERROR] [19428] [T0] [config:scripthandler] use static file handler for suffix [php72]
2023-12-11 13:35:32.186593 [ERROR] [19428] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp73.
2023-12-11 13:35:32.186595 [ERROR] [19428] [T0] [config:scripthandler] Can not find External Application: lsphp73, type: lsapi
2023-12-11 13:35:32.186597 [ERROR] [19428] [T0] [config:scripthandler] use static file handler for suffix [php73]
2023-12-11 13:35:32.186600 [ERROR] [19428] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp74.
2023-12-11 13:35:32.186602 [ERROR] [19428] [T0] [config:scripthandler] Can not find External Application: lsphp74, type: lsapi
2023-12-11 13:35:32.186604 [ERROR] [19428] [T0] [config:scripthandler] use static file handler for suffix [php74]
2023-12-11 13:35:32.186620 [INFO] [19428] [T0] [config:server:php] Try Litespeed PHP handlers
2023-12-11 13:35:32.186633 [INFO] [19428] [T0] Associate [lsphp80] with PHP handler [lsphp80].
2023-12-11 13:35:32.186639 [INFO] [19428] [T0] Add #1 suffix handler [lsphp80]->[lsphp80].
2023-12-11 13:35:32.186641 [INFO] [19428] [T0] Associate [lsphp81] with PHP handler [lsphp81].
2023-12-11 13:35:32.186646 [INFO] [19428] [T0] Add #2 suffix handler [lsphp81]->[lsphp81].
2023-12-11 13:35:32.186651 [INFO] [19428] [T0] [config:server:php] Try CloudLinux PHP selector handlers
2023-12-11 13:35:32.186656 [INFO] [19428] [T0] Create PHP handler [phpsel] with PHP binary [/usr/local/bin/lsphp]
2023-12-11 13:35:32.186661 [INFO] [19428] [T0] Add #3 suffix handler [phpsel]->[phpsel].
2023-12-11 13:35:32.186678 [INFO] [19428] [T0] Default PHP handler is [lsphp5], path [/usr/local/lsws/fcgi-bin/lsphp5]
2023-12-11 13:35:32.186682 [INFO] [19428] [T0] Add #4 suffix handler [php]->[lsphp5].
2023-12-11 13:35:32.186685 [INFO] [19428] [T0] Add #5 suffix handler [php5]->[lsphp5].
2023-12-11 13:35:32.186689 [INFO] [19428] [T0] Add #6 suffix handler [php80]->[lsphp80].
2023-12-11 13:35:32.186691 [INFO] [19428] [T0] Add #7 suffix handler [php81]->[lsphp81].
2023-12-11 13:35:32.186770 [INFO] [19428] [T0] [/usr/local/lsws/conf/httpd.conf:12] try to add listener: '*:80'.
2023-12-11 13:35:32.186783 [INFO] [19428] [T0] [/usr/local/lsws/conf/httpd.conf:13] try to add listener: '[::]:80'.
2023-12-11 13:35:32.186788 [INFO] [19428] [T0] [/usr/local/lsws/conf/httpd.conf:14] try to add listener: '*:443'.
2023-12-11 13:35:32.186792 [INFO] [19428] [T0] [/usr/local/lsws/conf/httpd.conf:15] try to add listener: '[::]:443'.
2023-12-11 13:35:32.186869 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/modsec.conf
2023-12-11 13:35:32.186869 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/modsec.conf
2023-12-11 13:35:32.186893 [INFO] [19428] [T0] Processing config directory: /usr/local/lsws/conf
2023-12-11 13:35:32.186893 [INFO] [19428] [T0] Processing config directory: /usr/local/lsws/conf
2023-12-11 13:35:32.186923 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxx.xxx.xx/vhost.conf
2023-12-11 13:35:32.186923 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxx.xxx.xx/vhost.conf
2023-12-11 13:35:32.186950 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf
2023-12-11 13:35:32.186950 [INFO] [19428] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf
2023-12-11 13:35:32.188797 [ERROR] [19428] [T0] [/usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf:34] Listener for _default_ is not available.
2023-12-11 13:35:32.188797 [ERROR] [19428] [T0] [/usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf:34] Listener for _default_ is not available.
[Mon Dec 11 13:35:32 2023] [notice] Finish reading Apache configuration, server configured -- resuming normal operations
2023-12-11 13:35:32.189017 [NOTICE] [19428] [T0] Litespeed is ready to serve...
2023-12-11 13:35:32.189176 [NOTICE] [19428] [T0] [AutoRestarter] new child process with pid=19431 is forked!
2023-12-11 13:35:32.189320 [INFO] [19431] [T0] registered RT signal 38
2023-12-11 13:35:32.189341 [INFO] [19431] [T0] [UDP 0.0.0.0:443] initPacketsIn: allocated 100 packets
2023-12-11 13:35:32.189364 [INFO] [19431] [T0] [UDP [::]:443] initPacketsIn: allocated 100 packets
2023-12-11 13:35:32.189464 [NOTICE] [19431] [T0] [Child: 19431] Setup swapping space...
2023-12-11 13:35:32.189480 [NOTICE] [19431] [T0] Successfully change current user to nobody
2023-12-11 13:35:32.189483 [NOTICE] [19431] [T0] Core dump is enabled.
2023-12-11 13:35:32.189589 [INFO] [19431] [T0] [SSL_APK] created offloader with 1 workers.
2023-12-11 13:35:32.189620 [INFO] [19431] [T0] [MODSEC] created offloader with 10 workers.
2023-12-11 13:35:32.189641 [INFO] [19431] [T0] [MODSEC_BODY] created offloader with 50 workers.
2023-12-11 13:35:32.189642 [ALERT] [19431] [T0] LiteSpeed/6.1.2 Enterprise starts successfully!

no error log upgrading from 8.0 to 8.2 (no changes in php version)

error log downgrading from 8.2 to 8.1:

2023-12-11 13:40:15.896232 [INFO] [19633] [T0] [config:server:php] Try Litespeed PHP handlers
2023-12-11 13:40:15.896246 [INFO] [19633] [T0] Associate [lsphp80] with PHP handler [lsphp80].
2023-12-11 13:40:15.896251 [INFO] [19633] [T0] Add #1 suffix handler [lsphp80]->[lsphp80].
2023-12-11 13:40:15.896254 [INFO] [19633] [T0] Associate [lsphp81] with PHP handler [lsphp81].
2023-12-11 13:40:15.896258 [INFO] [19633] [T0] Add #2 suffix handler [lsphp81]->[lsphp81].
2023-12-11 13:40:15.896263 [INFO] [19633] [T0] [config:server:php] Try CloudLinux PHP selector handlers
2023-12-11 13:40:15.896267 [INFO] [19633] [T0] Create PHP handler [phpsel] with PHP binary [/usr/local/bin/lsphp]
2023-12-11 13:40:15.896272 [INFO] [19633] [T0] Add #3 suffix handler [phpsel]->[phpsel].
2023-12-11 13:40:15.896289 [INFO] [19633] [T0] Default PHP handler is [lsphp5], path [/usr/local/lsws/fcgi-bin/lsphp5]
2023-12-11 13:40:15.896293 [INFO] [19633] [T0] Add #4 suffix handler [php]->[lsphp5].
2023-12-11 13:40:15.896296 [INFO] [19633] [T0] Add #5 suffix handler [php5]->[lsphp5].
2023-12-11 13:40:15.896301 [INFO] [19633] [T0] Add #6 suffix handler [php80]->[lsphp80].
2023-12-11 13:40:15.896303 [INFO] [19633] [T0] Add #7 suffix handler [php81]->[lsphp81].
2023-12-11 13:40:15.896348 [INFO] [19633] [T0] [/usr/local/lsws/conf/httpd.conf:12] try to add listener: '*:80'.
2023-12-11 13:40:15.896362 [INFO] [19633] [T0] [/usr/local/lsws/conf/httpd.conf:13] try to add listener: '[::]:80'.
2023-12-11 13:40:15.896366 [INFO] [19633] [T0] [/usr/local/lsws/conf/httpd.conf:14] try to add listener: '*:443'.
2023-12-11 13:40:15.896370 [INFO] [19633] [T0] [/usr/local/lsws/conf/httpd.conf:15] try to add listener: '[::]:443'.
2023-12-11 13:40:15.896446 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/modsec.conf
2023-12-11 13:40:15.896446 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/modsec.conf
2023-12-11 13:40:15.896471 [INFO] [19633] [T0] Processing config directory: /usr/local/lsws/conf
2023-12-11 13:40:15.896471 [INFO] [19633] [T0] Processing config directory: /usr/local/lsws/conf
2023-12-11 13:40:15.896499 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxx.xxx.xx/vhost.conf
2023-12-11 13:40:15.896499 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxx.xxx.xx/vhost.conf
2023-12-11 13:40:16.896655 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf
2023-12-11 13:40:16.896655 [INFO] [19633] [T0] Processing config file: /usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf
2023-12-11 13:40:16.898740 [ERROR] [19633] [T0] [/usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf:34] Listener for _default_ is not available.
2023-12-11 13:40:16.898740 [ERROR] [19633] [T0] [/usr/local/lsws/conf/vhosts/xxxb.xxx.xx/vhost.conf:34] Listener for _default_ is not available.
[Mon Dec 11 13:40:16 2023] [notice] Finish reading Apache configuration, server configured -- resuming normal operations
2023-12-11 13:40:16.899019 [NOTICE] [19633] [T0] Litespeed is ready to serve...
2023-12-11 13:40:16.899268 [NOTICE] [19633] [T0] [AutoRestarter] new child process with pid=19638 is forked!
2023-12-11 13:40:16.899460 [INFO] [19638] [T0] registered RT signal 38
2023-12-11 13:40:16.899483 [INFO] [19638] [T0] [UDP 0.0.0.0:443] initPacketsIn: allocated 100 packets
2023-12-11 13:40:16.899526 [INFO] [19638] [T0] [UDP [::]:443] initPacketsIn: allocated 100 packets
2023-12-11 13:40:16.928977 [NOTICE] [19431] [T0] New litespeed process is ready, stops listeners
2023-12-11 13:40:16.928996 [INFO] [19431] [T0] Stop all listeners.
2023-12-11 13:40:16.928999 [INFO] [19431] [T0] Stop listener *:443.
2023-12-11 13:40:16.929003 [INFO] [19431] [T0] Stop listener *:80.
2023-12-11 13:40:16.929005 [INFO] [19431] [T0] Stop listener [::]:443.
2023-12-11 13:40:16.929007 [INFO] [19431] [T0] Stop listener [::]:80.
2023-12-11 13:40:16.929009 [INFO] [19431] [T0] Stop listener *:7080.
2023-12-11 13:40:16.929011 [NOTICE] [19431] [T0] QuicEngine::startCoolDown(), active connections: 0
2023-12-11 13:40:16.929025 [NOTICE] [19431] [T0] Event-loop lingering done.
2023-12-11 13:40:16.929026 [NOTICE] [19431] [T0] Shut down successfully! 
2023-12-11 13:40:16.899633 [NOTICE] [19638] [T0] [Child: 19638] Setup swapping space...
2023-12-11 13:40:16.899655 [NOTICE] [19638] [T0] Successfully change current user to nobody
2023-12-11 13:40:16.899659 [NOTICE] [19638] [T0] Core dump is enabled.
2023-12-11 13:40:16.899767 [INFO] [19638] [T0] [SSL_APK] created offloader with 1 workers.
2023-12-11 13:40:16.899813 [INFO] [19638] [T0] [MODSEC] created offloader with 10 workers.
2023-12-11 13:40:16.899833 [INFO] [19638] [T0] [MODSEC_BODY] created offloader with 50 workers.
2023-12-11 13:40:16.899834 [ALERT] [19638] [T0] LiteSpeed/6.1.2 Enterprise starts successfully!

I tried to see the php configurations to obtain the parameters to manually edit the vhosts, when trying to see the configurations for 7.4 and 8.2 it also gives an error:

cat: /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini: No such file or directory
cat: /usr/local/lsws/lsphp82/etc/php/8.2/litespeed/php.ini: No such file or directory

When reviewing the content of /usr/local/lsws/lsphp74/etc/php/7.4 and /usr/local/lsws/lsphp82/etc/php/8.2 there is only the “mods-available” folder (should litespeed exist?). In the versions of php that work there are the “litespeed” and “mods-available folders”.

When reviewing the contect of litespeed found this error log:

2023-12-11 13:40:15.896149	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp53.
2023-12-11 13:40:15.896151	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp53, type: lsapi
2023-12-11 13:40:15.896153	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php53]
2023-12-11 13:40:15.896158	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp54.
2023-12-11 13:40:15.896160	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp54, type: lsapi
2023-12-11 13:40:15.896167	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php54]
2023-12-11 13:40:15.896172	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp55.
2023-12-11 13:40:15.896174	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp55, type: lsapi
2023-12-11 13:40:15.896175	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php55]
2023-12-11 13:40:15.896179	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp56.
2023-12-11 13:40:15.896180	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp56, type: lsapi
2023-12-11 13:40:15.896182	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php56]
2023-12-11 13:40:15.896185	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp70.
2023-12-11 13:40:15.896187	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp70, type: lsapi
2023-12-11 13:40:15.896189	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php70]
2023-12-11 13:40:15.896192	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp71.
2023-12-11 13:40:15.896194	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp71, type: lsapi
2023-12-11 13:40:15.896196	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php71]
2023-12-11 13:40:15.896199	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp72.
2023-12-11 13:40:15.896201	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp72, type: lsapi
2023-12-11 13:40:15.896202	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php72]
2023-12-11 13:40:15.896207	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp73.
2023-12-11 13:40:15.896209	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp73, type: lsapi
2023-12-11 13:40:15.896210	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php73]
2023-12-11 13:40:15.896214	ERROR	[19633] [T0] [config:scripthandler] Can not find handler with type: 17, name: lsphp74.
2023-12-11 13:40:15.896215	ERROR	[19633] [T0] [config:scripthandler] Can not find External Application: lsphp74, type: lsapi
2023-12-11 13:40:15.896217	ERROR	[19633] [T0] [config:scripthandler] use static file handler for suffix [php74]

As additional information, I had to comment out these lines after installing the panel (/etc/fstab), otherwise it didn’t work. I may have broken something

/cyberpanel.swap swap swap sw 0 0
/usr/.tempdisk /tmp ext4 loop,rw,noexec,nosuid,nodev,nofail 0 0
/tmp /var/tmp none bind 0 0
proc /proc proc defaults,hidepid=2 0 0

8.0 and 8.1 were redirected to 7.4 earlier.
I made a PR for that now.
Update php versions - V2.3.5 by master3395 · Pull Request #1202 · usmannasir/cyberpanel (github.com)