How to use php version 8.2.4 or 8.1.7?

I mean this. I attached step by step everything I did, I get an error like on the screenshot and then the compilation window is endless





How to check if compilation is going on? Nothing happens, just writes loading and that’s it

Seems you did not follow the instructions here How to use php version 8.2

I can’t follow this instruction, I have an error when I create a config

I searched for a solution but didn’t find it. What am I doing wrong ? Ubuntu 20.04

This is an issue of making making ./configure executable chmod +x configure This should work.

How to use php version 8.2 this process works perfectly on Ubuntu 20.04


Error

Kindly use the forum to your advantage. Such an issue has been resolved for other users such as yourself How to install Php Curl & Php Sqlite3 - #2 by josephgodwinke

Done, buy have new error

checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE... yes
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
configure: error: Cannot find imap library (libc-client.a). Please check your c-client installation.

Is this centos ? cause I bet it was ubuntu from your topic description

I have ubuntu Ubuntu 20.04

is this a new installation ?

What do you have in mind “New”? I installed the cyberpanel a couple of hours ago
Maybe need change it here?

./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'

Or copy the library somewhere? Like that

--with-imap=/usr/lib/libc-client.a

?

Not helped (

The fix would be installing a couple of libraries manually and this would be error prone and a waste of valuable time.

Reset your server to have a clean os with no webservers, databases, php.

Install latest cyberpanel on ubuntu 20.04 then use the recommended steps to install the php version of your choice. Please if you can avoid installing from source.

$ apt-cache search lsphp
# install all essentials for cyberpanel
$ apt-get install lsphp81 lsphp81-common lsphp81-mysql lsphp81-sqlite3 lsphp81-mbstring lsphp81-iconv lsphp81-mailparse lsphp81-imap lsphp81-intl lsphp81-zip lsphp81-gd lsphp81-curl lsphp81-xml lsphp81-bcmath

If not follow

then

$ 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

Do you check your instructions yourself? After installing a clean system, I also installed this:

apt-get install libc-client2007e-dev
sudo apt install libsqlite3-dev

since I had an error every time
Your instruction just doesn’t work. Now missing libc-client.a

You write instructions that no longer work, or there are not enough points in it.

Those are not my instructions those are the official instructions on litespeed website - the only change I added was the build-essential mistake they did.

I have used the steps so many times. Kindly check with your provider to give you a clean os preferably ubuntu 20.04

You also installed php in two different ways which conflicts. Check you followed instructions by @quoviz_dev which work too and the instructions I gave @fayssal . @quoviz_dev suggests you

If you choose to install from source you are basically on your own meaning errors will follow you depending on what you have installed, network issues etc.

2 Likes

And so by I managed to compile php 8.1.18 changed compilation options to the following:

./configure  '--prefix=/usr/local/lsws/lsphp81' '--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'

Changed
'--with-imap=/usr'
to
'--with-imap-usr'

After that I get a warning

end of compilation:


after I did the openlitespeed setting, but the version has not changed

What did I do wrong?

If I try to compile php 8.2, then I also need to modify the line in the same way

Changed
'--with-imap=/usr'
to
'--with-imap-usr'

and remove this one because of the error

'--with-mysqli=/usr/bin/mysql_config'


Again warning

After that, it compiles, but it ends with an error.

I tested on a new system of different OS versions, the errors are the same. Ubuntu 18, Ubuntu 20, Centro 7 and 8
Based on the conclusions, your instruction is not correct. Or am I doing something wrong?

Note if it works for others it means you should not add or remove anything. Follow the steps as they are and it should work.

We do not recommend Centos 7 for new installation so stop trying on that os.

Yet again I discourage building from source.

Build complete.
Don't forget to run 'make test'.

root@vps:~/php-8.1.18# make install
Installing shared extensions:     /usr/local/lsws/lsphp81/lib/php/extensions/no-debug-non-zts-20210902/
Installing PHP CLI binary:        /usr/local/lsws/lsphp81/bin/
Installing PHP CLI man page:      /usr/local/lsws/lsphp81/php/man/man1/
Installing phpdbg binary:         /usr/local/lsws/lsphp81/bin/
Installing phpdbg man page:       /usr/local/lsws/lsphp81/php/man/man1/
Installing PHP CGI binary:        /usr/local/lsws/lsphp81/bin/
Installing PHP CGI man page:      /usr/local/lsws/lsphp81/php/man/man1/
Installing build environment:     /usr/local/lsws/lsphp81/lib/php/build/
Installing header files:          /usr/local/lsws/lsphp81/include/php/
Installing helper programs:       /usr/local/lsws/lsphp81/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/lsws/lsphp81/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lsws/lsphp81/lib/php/
[PEAR] Archive_Tar    - installed: 1.4.14
[PEAR] Console_Getopt - installed: 1.4.3
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.5
warning: pear/PEAR dependency package "pear/Archive_Tar" installed version 1.4.14 is not the recommended version 1.4.4
[PEAR] PEAR           - installed: 1.10.13
Wrote PEAR system config file at: /usr/local/lsws/lsphp81/etc/pear.conf
You may want to add: /usr/local/lsws/lsphp81/lib/php to your php.ini include_path
/root/php-8.1.18/build/shtool install -c ext/phar/phar.phar /usr/local/lsws/lsphp81/bin/phar.phar
ln -s -f phar.phar /usr/local/lsws/lsphp81/bin/phar
Installing PDO headers:           /usr/local/lsws/lsphp81/include/php/ext/pdo/
root@vps:~/php-8.1.18#

Does this mean that the compilation completed successfully or not? If yes, which path should be written in Openlitespeed

It doesn’t work for me, I tried to do it many times

What is next step when did I compile?