Failed to edit php configurations

Hello everybody,
I just installed CyberPanel on my VPS. When i try to edit php configurations i got this error message " local variable ‘post_max_size’ referenced before assignment". Also when i switch to Advanced i got another error "cat: /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini: No such file or directory
". Please help me to get this working.
screenshots: [‘’, ‘’];

I am having the same issue, I think OpenLiteSpeed does not support that yet, however, Cyberpanal 1.9.3 does.
Using OLS: 1.6.5

Same issue on php 8.0

1 Like

Any update for this issue
Error message: local variable ‘post_max_size’ referenced before assignment

The same error. Please tell me how to fix it.

Please share more details like the Operating system of your server and the cyberpanel version?

Happens to me after fresh install of a 2.1.2 Cyberpanel on 8.5 almalinux.

cat: /usr/local/lsws/lsphp56/etc/php.ini: No such file or directory
Also for 5.3, 5.4 , 5.5, and 7.0

Tried to update cyberpanel for no avail.


I installed Rocky 8.5 base, with same result.

Actually Rocky, Alamalinux and Centos all uses same structure.
Can you try in Ubuntu and see if its same issue in that setup too?

I know you are using almalinux also, did cyberpanel created support for php 5.3, 5.4, 5.6, 7.0 in your instalation ?

Or simply Almalinux , Rocky, Centos 8 don’t support php below version 7.1?

Almalinux , Rocky, Centos 8
These three versions have some bugs with PHP 8 and so on.
Try unbuntu 20.04 and you will find everything ok

Nope… same issue here on Ubuntu 20.04 Cyberpanel 2.1.2 – can’t edit PHP 8.0 or 8.1 under PHP – also tried changing a site in Cyberpanel to PHP 8.0, but although it says it applied the change successfully the site is still running on PHP 7.4.

Same issue for me. Ubuntu 20.04, CyberPanel 2.1.2. Just upgraded CyberPanel as well. Couldn’t edit 8.1.

cat: /usr/local/lsws/lsphp81/etc/php.ini: No such file or directory

I ran apt install lsphp81 and now the php.ini file shows.

But I get this error when I try to install extensions (presumably since they dont exist): Cannot fetch details. Error message: PHP matching query does not exist.

Same error here for PHP 8.1 after update Cyberpanel to 2.3

Same issue here. (Issue only for PHP 8.1)

I am running three identical instances, all three on Oracle Cloud, same shape (1 Core, 1GB RAM, 47GB SSD), same image (20.04 LTS), and all three running the same build of CyberPanel 2.3 (latest build)
Yet, I am facing this issue only on one of the three instances.
I encountered this issue on one of the three, a few months ago when all three instances were running CyberPanel 2.2, didn’t bother at that point, however need it resolved soon

I tried “apt-get install lsphp81” as advised in another thread. That allowed me to edit my PHP settings but broke the websites, which ended up showing the error: “There has been a critical error on this website.”

Anyone’s got a lead yet?

you can re-install lsphp80 using apt-get install lsphp80* . This will install all lsphp80 packages you can also install selected packages as per your needs. this fixed my error

1 Like

Actually I get this specific error if I try to select PHP 7.2
I get other errors if I try to select anything below PHP8.0. I am on Ubuntu 22.x
Thanks for any insights.

Note: Ubuntu 22.04 have PHP Versions PHP 7.4 and above.

I too have encountered this problem when compiling additional versions of php on ubuntu 20.04.
The problem is that CybebrPanel is looking for the php.ini file in the paths:



1687                 if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
1688                     path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini"
1689                 else:
1690                     initial = phpVers[3]
1691                     final = phpVers[4]
1693                     completeName = str(initial) + '.' + str(final)
1694                     path = "/usr/local/lsws/ls" + phpVers + "/etc/php/" + completeName + "/litespeed/php.ini"

In short, for CentOS distributions, the path to the main php.ini file looks like this - /usr/local/lssws/lsphpXX/etc/php. ini and for others (Debian/Ubuntu) it should be listed as /usr/local/lssws/lsphpXX/etc/php/X.X/litespeed/php.ini, for example /usr/local/lssws/lsphp71/etc/php/7.1/litespeed/php.ini. If you compiled php manually, specify the following build directives (taken from a build of another version of php available in the repository):

--with-config-file-path=/usr/local/lswssws/lsphp71/etc/php/7.1/litespeed/ --with-config-file-scan-dir=/usr/local/lsws/lsphp71/etc/php/7.1/mods-available/ --libdir=/usr/local/lsws/lsp71/lib/php --libexecdir=/usr/local/lsws/lsp71/lib/php --datadir=/usr/local/lsws/lsp71/share/php/7.1

Note that lsphp71 is specified without a dot and /7.1/ with a dot.
You will then need to create directories at the specified paths:

mkdir -p /usr/local/lsws/lsphp71/etc/php/7.1/mods-available/
mkdir -p /usr/local/lssws/lsphp71/etc/php/7.1/litespeed/

And put the .ini files in these