CyberPanel Community

How to use php version 8.2

fa
fayssal #1

Hello,
Anybody know to how upgrade php version 8.2. I have a website does not support 8.1 so I need to upgrade the php version to 8.2.
Please can you suggest a method or help me with a topic?

31 replies
jo
josephgodwinke #2

Ramadhan Mubarak @fayssal

To install php 8.2 on ubuntu

apt-get install lsphp82 lsphp82-common lsphp82-mysql

Prefer from source ?

$ apt-get install build-essential pkg-config openssl libssl-dev openssl-blacklist openssl-blacklist-extra  bison autoconf automake libtool re2c flex libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libdb5.1-dev libjpeg-dev libpng12-dev libXpm-dev libfreetype6-dev libt1-dev libgmp3-dev libc-client2007e-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libmysqlclient-dev libncurses5-dev libpcre3-dev unixODBC-dev libsqlite0-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libt1-dev
$ cd /tmp
$ wget https://www.php.net/distributions/php-8.2.4.tar.gz
$ tar -xf php-8.2.4.tar.gz
$ cd php-8.2.4
## It is absolutely required to run ./configure with --with-litespeed since we have to build PHP with LSAPI
$ ./configure  '--prefix=/usr/local/lsws/lsphp82' '--with-libdir=lib64' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--with-curl' '--with-openssl' '--with-gettext' '--with-mcrypt' '--enable-mbstring=all' '--enable-mbregex' '--with-png-dir=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--enable-ftp' '--with-imap=/usr' '--with-imap-ssl' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--enable-pcntl' '--with-freetype-dir=/usr' '--with-pdo-mysql=/usr' '--with-litespeed'
$ make
$ make install

Then configure PHP 8.2 in WebAdmin console to be used as SAPI app

You need to restart lsws service for these changes to be effected.

service lsws reload
fa
fayssal #3

thank you @ josephgodwinke
You too Ramadan Mubarak Bro.
I install ubuntu method but it does’t work with me. please can help me?
i don’t understand the second case prefer from source?

jo
josephgodwinke #4

compiling PHP with LSAPI from source

jo
josephgodwinke #5

Which part are you stuck ?

fa
fayssal #6
apt-get install lsphp82 lsphp82-common lsphp82-mysql
fa
fayssal #8

it installed but it dones’t appear in the php version

jo
josephgodwinke #9

It will not appear under CyberPanel until a future release. For now you can use it like this:

fa
fayssal #10

i’m sorry i don’t understand you i’m a beginner in that field. please can you explain me step by step.
i login to litespeed webadmin panel console what next step can i do?

jo
josephgodwinke #11

Click Virtual Hosts → myphp8.2website → External App → Add new LSAPI app with address uds://tmp/lshttpd/lsphp82.sock

fa
fayssal #12

this command is not work for me. is there any problem?

fa
fayssal #14

message appear:
E: Invalid operation build-essential

jo
josephgodwinke #15

Run sudo apt-get update && sudo apt-get install build-essential first if that works revert back here

fa
fayssal #16

the command works: sudo apt-get update && sudo apt-get install build-essential
what is the next step?

jo
josephgodwinke #17

This whole command - run it

fa
fayssal #18

it doesn’t work sir

jo
josephgodwinke #19

Did your run

$ apt-get build-essential pkg-config openssl libssl-dev openssl-blacklist openssl-blacklist-extra  bison autoconf automake libtool re2c flex libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libdb5.1-dev libjpeg-dev libpng12-dev libXpm-dev libfreetype6-dev libt1-dev libgmp3-dev libc-client2007e-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libmysqlclient-dev libncurses5-dev libpcre3-dev unixODBC-dev libsqlite0-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libt1-dev
fa
fayssal #20

yes i did but it doesn’t work

fa
fayssal #22

E: Invalid operation build-essential

fa
fayssal #24

ubuntu 20 version

jo
josephgodwinke #25
$  apt-get install build-essential pkg-config openssl libssl-dev openssl-blacklist openssl-blacklist-extra bison autoconf automake libtool re2c flex libxml2-dev libssl-dev libbz2-dev libcurl4-openssl-dev libdb5.1-dev libjpeg-dev libpng12-dev libXpm-dev libfreetype6-dev libt1-dev libgmp3-dev libc-client2007e-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libmysqlclient-dev libncurses5-dev libpcre3-dev unixODBC-dev libsqlite0-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libt1-dev

Run it like that and continue with preceeding steps

AD
Andre Dsousa #26

@josephgodwinke Can you shared the link from that Server Configuration->External App I did not find it in my CyberPanel.

Thanks

jo
josephgodwinke #27

LiteSpeed-WebAdmin-Console

Log into webadmin console and look for the above

AD
Andre Dsousa #28

Thank you @josephgodwinke

For the users like me that never went into the OpenLiteSpeed webadmin before, the admin panel is served in:

your-ip:7080

Also in the case like me again :stuck_out_tongue_winking_eye: that never ever visited before. you need to assign the user/password.

Log in via ssh and run the OpenLiteSpeed admpass.sh in here to assign the credentials.

/usr/local/lsws/admin/misc/admpass.sh 

Edit:

I recommend you to login with http://your.server.ip:7080/ since https will logs you out at any click.

in
indobo #29

Any update for this thread? For me it didnt work also :cry:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libreadline-dev’ instead of ‘libreadline6-dev’
Note, selecting ‘libxslt1-dev’ instead of ‘libxslt-dev’
Package libdb5.1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libpng12-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package openssl-blacklist is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘openssl-blacklist’ has no installation candidate
E: Unable to locate package openssl-blacklist-extra
E: Package ‘libdb5.1-dev’ has no installation candidate
E: Package ‘libpng12-dev’ has no installation candidate
E: Unable to locate package libXpm-dev
E: Unable to locate package libt1-dev
E: Unable to locate package unixODBC-dev
E: Unable to locate package libt1-dev

Sign in to reply