+- AdminsForum (https://adminsforum.com)
+-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels)
+--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel)
+---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials)
+----- Forum: CyberPanel PHP & LSPHP Guides (https://adminsforum.com/Forum-cyberpanel-php-lsphp-guides)
+----- Thread: Guide CyberPanel: Change the PHP Version of One Website (and Per-Site PHP Settings) (/Thread-guide-cyberpanel-change-the-php-version-of-one-website-and-per-site-php-settings)
CyberPanel: Change the PHP Version of One Website (and Per-Site PHP Settings) - JAY - 10-26-2026
CyberPanel: Change the PHP Version of One Website (and Per-Site PHP Settings)
CyberPanel lets every website run its own PHP version. That's useful when an old plugin or script breaks on a new PHP, or when you want to test PHP 8.4 on one site before moving the rest. Changing it takes one click, but two things catch people out: the switch isn't instant, and SSH/cron still use the server's default PHP. Then there's the next question: how do you give one site more memory or a bigger upload limit? On CyberPanel with OpenLiteSpeed, the usual cPanel tricks don't work. We tested all of it on our server.
Which PHP versions you have
Each version lives in its own folder:
Code:
ls -d /usr/local/lsws/lsphp*
Ours had
Code:
lsphp81
to
Code:
lsphp85
. A version only shows up in the panel's dropdowns if it's installed. Missing extensions per version are covered in our PHP extensions guide.
Step 1: Change the PHP version in the panel Websites > List Websites > Manage (for a subdomain or addon domain: Websites > List Child Domains > Manage). We used our test subdomain
Code:
blog.cyber.adminslab.com
, which ran PHP 8.3.
Open the site, scroll to Configurations and click Change PHP:
Pick the version and click Change PHP. The panel says PHP successfully changed. One small trap: on our build the dropdown is empty when the page opens, so the panel doesn't tell you which version the site uses right now. Check it from SSH before and after (Step 2).
What the button actually does: it edits one line in the site's OpenLiteSpeed config,
Code:
/usr/local/lsws/conf/vhosts/yoursite/vhost.conf
:
Code:
path /usr/local/lsws/lsphp82/bin/lsphp
Nothing else in the file changes, so your other vHost settings stay as they are.
Step 2: Check that the site really switched
Put a tiny test file in the site folder (as the site user, so it gets the right owner):
on the command line still says 8.3.36. Two lessons from this:
Give it a few seconds. Our very first request right after the click still came back as 8.3.36; the old PHP processes finish their work first. Within about 10 to 30 seconds every request was on the new version, both times we switched. No manual restart needed.
The command line doesn't follow.
Code:
php
in SSH, cron jobs, Composer and WP-CLI use the server's default PHP, not the site's. If your site runs 8.2, call that version's binary directly:
That matters most for cron jobs and for Laravel's artisan: a script that works on the site can fail from cron because it runs on a different PHP.
Delete
Code:
v.php
when you're done.
Step 3: Change PHP settings for one site only Server > PHP > Edit PHP Configs changes
Code:
php.ini
for every site on that PHP version (see our php.ini guide). Often you only want one site to get more memory or a bigger upload limit. We tried the three usual ways on the same site:
Code:
.user.ini
in the site folder with
Code:
post_max_size = 77M
Code:
.htaccess
with
Code:
php_value upload_max_filesize 64M
Code:
phpIniOverride
in the site's vHost config with
Code:
upload_max_filesize 64M
and
Code:
memory_limit 256M
Here is our test with all three in place on the same site:
.user.ini: ignored.
Code:
post_max_size
stayed at the server's 8M, also after the 5-minute
Code:
user_ini.cache_ttl
and with fresh PHP processes.
.htaccess php_value: ignored. OpenLiteSpeed reads rewrite rules from
Code:
.htaccess
, but not PHP settings. No error either, which is why people don't notice. (On LiteSpeed Enterprise this line does work.)
vHost phpIniOverride: works. 256M and 64M, right after a restart.
So on CyberPanel with OpenLiteSpeed, per-site PHP settings go into the vHost config.
In the panel it's vHost Conf on the same page. Ours, after the change:
Find the existing block (it's empty by default) and add your settings inside: