CyberPanel Community

Changing PHP version not working on latest 2.1.2 update

Ma
Master3395 #1

Hi,

I am trying to update my php version on several domains and subdomains.
All result in 0 changes.

I have run the upgrader several times.
I have an old 2.1.2 VPS set up, where it works.
I have made sure the PHP settings are the same (Copied the advanced tab from the working to the non-working).

Below is me entering the site (After clearing cache)
It does still show PHP 7.4.27

Same problem on root domain.


Still show 7.4.27

Error log.

Just ran the upgrader once more, same result.

32 replies
Ma
Master3395 #4

Anyone got any suggestions to what i can try, because it’s starting to get annoying that I can’t change PHP version on any domains or sub domains at all.
It’s stuck with what I give them on creation.

NK
Nitesh Kunnath #5

This issue I personally faced for websites created under child domains in cyberpanel. When you pointed out the subdomains have permissions issue in some other thread, I realized the cause of this issue.

You might have changed permission level or its changed for whatsoever reason for which this error will surface for that reason.

Before usman adding the fix, what I did as temp fix for my sites was I converted child domains to website and there I could access the PHP version changes.

You will have to play with it.

But I am unable to understand why the upgrade command didnt help you because the fixes were applied.

Secondly, just open filemanager and click on fix permissions and retry.

RM
Rana Muhammad Usman Nasir #6

I will check and revert here.

Ma
Master3395 #7

I tried again, i deleted the subdomain using IP/websites/listChildDomains
And remove the root also.

And then re-create it as a subdomain, it did update the perms, but it sadly still gave the error.

Your right about making it it’s own domain fixed the permissions altogether.
I can change the PHP settings as needed, as long as it stays “root domain”

Putting it back as a subdomain under my root URL after works fine.
BUT you can’t change PHP from the root URL “list” over sub-domains nor inside the subdomain URL.

ex CP url
IP/websites/newstargeted.com
IP/websites/newstargeted.com/mas.newstargeted.com

RM
Rana Muhammad Usman Nasir #8

It seems that PHP version is changing for me, kindly show me vhost conf after changing php version

Ma
Master3395 #9

Changed from 8.1.2 down to 7.0 on my subdomain mas.newstargeted.com
From the sub domain it self.

Summary
docRoot                   /home/newstargeted.com/mas.newstargeted.com
vhDomain                  $VH_NAME
vhAliases                 www.$VH_NAME
adminEmails               info@newstargeted.com
enableGzip                1
enableIpGeo               1

index  {
  useServer               0
  indexFiles              index.php, index.html
}

errorlog $VH_ROOT/logs/newstargeted.com.error_log {
  useServer               0
  logLevel                WARN
  rollingSize             10M
}

accesslog $VH_ROOT/logs/newstargeted.com.access_log {
  useServer               0
  logFormat               "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i""
  logHeaders              5
  rollingSize             10M
  keepDays                10  
  compressArchive         1
}

phpIniOverride  {

}

module cache {
 storagePath /usr/local/lsws/cachedata/$VH_NAME
}

errorpage 403 {
  url                     403.html
}

errorpage 404 {
  url                     404.html
}

errorpage 500 {
  url                     500.html
}

scripthandler  {
  add                     lsapi:newst12763115 php
}

extprocessor newst12763115 {
  type                    lsapi
  address                 UDS://tmp/lshttpd/newst12763115.sock
  maxConns                10
  env                     LSAPI_CHILDREN=10
  initTimeout             60
  retryTimeout            0
  persistConn             1
  pcKeepAliveTimeout      1
  respBuffer              0
  autoStart               1
  path                    /usr/local/lsws/lsphp81/bin/lsphp
  extUser                 newst1276
  extGroup                newst1276
  memSoftLimit            2047M
  memHardLimit            2047M
  procSoftLimit           400
  procHardLimit           500
}

rewrite  {
  enable                  1
  autoLoadHtaccess        1
}

context /.well-known/acme-challenge {
  location                /usr/local/lsws/Example/html/.well-known/acme-challenge
  allowBrowse             1

  rewrite  {

  }
  addDefaultCharset       off

  phpIniOverride  {

  }
}


vhssl  {
  keyFile                 /etc/letsencrypt/live/mas.newstargeted.com/privkey.pem
  certFile                /etc/letsencrypt/live/mas.newstargeted.com/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling           1
  ocspRespMaxAge           86400
}
RM
Rana Muhammad Usman Nasir #10

For subdomain I will check and let you know

Ma
Master3395 #11

Have you found any issues with it?

an
antivirusadmin #12

Hi @usmannasir
I faced with this in last version that you updatet last night , I don’t know if related to the permissions or it’s old
Just want to know is it possible that subdomain use the other version of php ?
Thanks

NK
Nitesh Kunnath #13

There was an issue but it was resolved 1-2 months back.

Ma
Master3395 #14

It wasn’t resolved, at least it isn’t in the latest stable now.

MK
Mirza Khadnezar S [sick] #15

up to 2.3.1 latest version

then change the php to 8.0
reboot server

let me know

this is not a solution
but we are trying helping you out step by step

Hu
Hulst88 #16

I tried. Updated cyberpanel last night but still unable to change php version.
What can I try next? I am doing a website migration but the export plugin doesn ot support this php version. Both add-on domain and main domain do not change since I updated cyberpanel 2 weeks ago

[EDIT] I have changed Vhost php version and now it worked

Ma
Master3395 #17

This saved me yeah. @Hulst88
You are right, editing the Vhost individually works!

But changing it using any of the two options CP provides does not work for 8.0 or up.
It works for 7.4 sometimes.

And yes you would then also need to go into Edit PHP configuration to restart PHP.
Perhaps that should change, when you change PHP, it should restart PHP (At least for that vhost)

Here are the options that don’t work.

Option 1:

Option 2:

MK
Mirza Khadnezar S [sick] #18

actually i have already post about this procedure
and request if developer can put 1 line to auto restart php after changed success

Ma
Master3395 #19

If you know the line and place, i can make a pull.

MK
Mirza Khadnezar S [sick] #20

unfortunately
i dont know :frowning:

MK
Mirza Khadnezar S [sick] #23

yeah… somewhere… at here… diemrw or someone talk about every config is using 7.3

Al
AlexBoy #24

Did you guys find a way to change the PHP version on subdomains? @usmannasir

ph
phpfigureout #25

I just found the solution (workaround).

Change the version in vHost Conf:
Choose one:
path /usr/local/lsws/lsphp72/bin/lsphp
path /usr/local/lsws/lsphp73/bin/lsphp
path /usr/local/lsws/lsphp74/bin/lsphp
path /usr/local/lsws/lsphp80/bin/lsphp
path /usr/local/lsws/lsphp81/bin/lsphp

save

Go to Change PHP and change the version in the one you choose in vHost Conf.
And click Change PHP

It’s not nice, but it works as a workaround! Hope they will fix this!

Ma
Master3395 #26

@usmannasir

Changing the PHP from the domain or subdomain does not change the Vhost file at all.
The only solution is to do what @phpfigureout said over, where you replace the line with the working one, then save and check again.

Also, there’s a problem with Php 8.1, it just loads blank.
8.0 works fine.


Di
Diego #27

I’m having this problem too, vhost config of the domain looks good but wordpress is showing old php.

sv
svenms #29

CP: 2.3.2
Commit: 60d048f82acbf3a35b626f0f33782c4c73e77b86
LiteSpeed Enterprise

I’am having the same problem.
Vhost config shows the main Site is using Php 8.0, but php version is not changing subdomains version.

On the other hand, php current version should be shown automatically when entering the option to change it. Right now, you do not know what is the current one for main site or subdomains unless you run a script on each site.

Also, Php8.1 version seems not to be loaded in CP. It is just displayed as an option but no settings are displayed. It is not available yet right?

DI
Dick Impens #30

I have the same problem, but it’s not that WordPress PHP isn’t updated, it is. Only does not show in the WordPress → List WordPress → WordPress Manager.

I have WordPress 8.0 installed on this site, checked in WordPress, which is correct, I set it to PHP 8.0
But this is what the manager shows:

Current Version: 2.3 ( Up-to-date: 13-10-2022)

A bit confusing, as now you’re never shure.

as
asheboro #31

Just throwing this out there. I had the same problem on my multisite install. Make sure you’re updating the PHP path in the vhost for the domain you’re trying to affect. Basically, pull up the List Domains, click the Launch button next to your domain and edit the vhost there.

Ma
Master3395 #32

@usmannasir It seems that php 8.2 is missing files in /usr/local/lsws/lsphp82/bin
Do you know if there’s an easy command to re-install or make these files?

8.1:
image

8.2:
image

RM
Rana Muhammad Usman Nasir #33

By just running the uninstall and install command again depending upon the OS.

Ma
Master3395 #34

I saw that lsphp82.x86_64 8.2.16-2.el8 @litespeed-update wasn’t installed.
Installing it fixed PHP 8.2 :slight_smile:

Sign in to reply