Select PHP version 8.3 in Active PHP versions

I updated PHP from 8.2 to 8.3.

# Install new PHP 8.3 packages
sudo apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}

# Install FPM OR Apache module
sudo apt install php8.3-fpm
# OR
# sudo apt install libapache2-mod-php8.3

# On Apache: Enable PHP 8.3 FPM
sudo a2enconf php8.3-fpm
# When upgrading from an older PHP version:
sudo a2disconf php8.2-fpm

root:~# php -v
PHP 8.3.8 (cli) (built: Jun 8 2024 21:31:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.8, Copyright (c) Zend Technologies
with Zend OPcache v8.3.8, Copyright (c), by Zend Technologies

The selector only appears 8.2

php3

The backend server appears php8.3-fpm

I just need the selector to appear 8.3.

That is not the right way to install php 8.3 in Hestia, the right way is:

v-add-web-php 8.3

Regarding 8.3 not appearing in web ui, execute this command as root:

sed -i '/^\t"php-8.2",/a \\t"php-8.3",' /usr/local/hestia/web/edit/server/index.php
1 Like

The command was invalid

root:~# v-add-web-php 8.3
-bash: v-add-web-php: command not found

Then use the full path:

/usr/local/hestia/bin/v-add-web-php 8.3

2 Likes

It worked out. Thank you all!

The only doubt. Is it normal to appear admin in 8.3?

image

If that is the only user yes

2 Likes

Thanks

My server spec:

Hestia Control Panel v1.8.12
Operating System Ubuntu 20.04 (x86_64)

Is it possible to add PHP 8.3 to this? My latest version is 8.2 but I need also 8.3

Yes, just follow the same steps:

v-add-web-php 8.3
sed -i '/^\t"php-8.2",/a \\t"php-8.3",' /usr/local/hestia/web/edit/server/index.php

After installing it, check the default php version:

php -v

If it is php 8.3 and you want the default version as 8.2, execute this command:

v-change-sys-php 8.2

I tried but getting this:

Last login: Thu Aug 29 19:48:43 2024 from 204.152.80.155
ubuntu@futurecarib:~$ v-add-web-php 8.3
/usr/local/hestia/func/main.sh: line 1575: /usr/local/hestia/conf/hestia.conf: Permission denied
Multiple php versions are not supported for modphp
grep: /usr/local/hestia/conf/hestia.conf: Permission denied
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Installing PHP-8.3, please wait… -
ERROR: Installation failed, please run the following command manually for debugging:
apt-get install php8.3-common php8.3-mbstring php8.3-bcmath php8.3-cli php8.3-curl
php8.3-fpm php8.3-gd php8.3-intl
php8.3-soap php8.3-xml php8.3-zip php8.3-bz2
php8.3-pspell php8.3-imagick php8.3-imap php8.3-ldap
cp: cannot create regular file ‘/etc/php/8.3/fpm/pool.d/’: No such file or directory
sed: can’t read /etc/php/8.3/fpm/pool.d/dummy.conf: No such file or directory
cp: cannot create regular file ‘/etc/php/8.3/fpm/’: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php-fpm.conf: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/cli/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
sed: can’t read /etc/php/8.3/fpm/php.ini: No such file or directory
cp: cannot create regular file ‘/usr/local/hestia/data/templates/web/php-fpm/PHP-8_3.tpl’: Permission denied
/usr/local/hestia/func/main.sh: line 1575: /usr/local/hestia/conf/hestia.conf: Permission denied
touch: cannot touch ‘/usr/local/hestia/data/users/admin/system.log’: Permission denied
wc: /usr/local/hestia/data/users/admin/system.log: Permission denied
/usr/local/hestia/func/main.sh: line 132: [: : integer expression expected
tail: cannot open ‘/usr/local/hestia/data/users/admin/system.log’ for reading: Permission denied
/usr/local/hestia/func/main.sh: line 146: /usr/local/hestia/data/users/admin/system.log: Permission denied
/usr/local/hestia/func/main.sh: line 100: /usr/local/hestia/log/system.log: Permission denied
ubuntu@futurib:~$

You must execute the commands as root.

sudo v-add-web-php 8.3
sudo sed -i '/^\t"php-8.2",/a \\t"php-8.3",' /usr/local/hestia/web/edit/server/index.php

Seems you are using nginx+apache2 but apache2 is using mpm_prefork instead of mpm_event so you won’t be able to use multiple php versions.

I have multiple website on server all using different PHP versions so are you saying that if I do this I won’t be able to?

My comment was not accurate, I meant mpm_prefork and mod_php based on the error Multiple php versions are not supported for modphp but that message is only because you didn’t execute the command as root.

You can execute the command to install php 8.3, no problem, but do it as root.

I tried but I get this:

sudo: v-add-web-php: command not found

But then I checked my control panel and saw that 8.3 was added

Use this:

sudo /usr/local/hestia/bin/v-add-web-php 8.3
1 Like

Bless you. It works now

2 Likes