Newest php8.4 on Debian / Ubuntu: How to install and test your server with the newest PHP 8.4 on Ubuntu or Debian.
Please advise
1 Answers
Answer to How to install Newest php8.4 on Debian / Ubuntu:
This may be of interest to those of you who want to test Nextcloud with the newest PHP 8.4 on Ubuntu or Debian.
You can easily set this up with these two scripts:
You’ll probably do your php updates already with the
At the moment I’m writing this, PHP 8.4 is still in RC status, so in its early stages, and a lot of PHP modules are still not delivered, including some that are absolutely necessary to operate Nextcloud. As after the release of php8.3, most modules will be delivered by the maintainer as package versions over time. Nevertheless, some modules will not be packaged and can be built with this script though, even if builds do not succeed with pecl. The
It can only build one module per call. So if you need three modules, you will have to run it three times, one for every single module.
Happy hacking! Much and good luck,
You’ll probably do your php updates already with the
php-updater
script with builtin php.net
-defaults and -changelog of the most php-ini directives and a verbose explanation. Install it with:
sudo wget -qO /usr/local/bin/php-updater https://global-social.net/script/php-updater
sudo chmod +x /usr/local/bin/php-updater
Explanation:
- the first line downloads the script into the directory /usr/local/bin
- the second line makes it executable
You only need to install it once.
As all of my → ebtb ← scripts, it comes signed and does an integrity check on the first run and checks for updates on every startup.
Once installed, simply run it:
php-updater
… and choose to install the version php8.4. Abort the script at the point where the settings from your old php version (probably 8.2 or 8.3) are to be integrated into the new php8.4, because not all modules are installed yet at that point.
At the moment I’m writing this, PHP 8.4 is still in RC status, so in its early stages, and a lot of PHP modules are still not delivered, including some that are absolutely necessary to operate Nextcloud. As after the release of php8.3, most modules will be delivered by the maintainer as package versions over time. Nevertheless, some modules will not be packaged and can be built with this script though, even if builds do not succeed with pecl. The
php-module-builder
script makes it easy to build and install all essential modules that are not (yet) available as Debian packages. The modules installed with this tool can also be removed just as easily. So the entire administration for the self-built modules is handled by one script. There is no need to make any changes to the php.ini
; the modules are all integrated into PHP by the script with Debian-style symlinks and locations, along with their own little ini files.
It has an automatic patching function that scans the source code before building the modules and updates old deprecated functions and include-pathes to comply with the new version for php8.4. This means that you can already now use modules like igbinary and redis, even though there are no oficial releases for php8.4 yet.
Installation of the script:
sudo wget -qO /usr/local/bin/php-module-builder https://global-social.net/script/php-module-builder
sudo chmod +x /usr/local/bin/php-module-builder
Explanation:
- the first line downloads the script into the directory /usr/local/bin
- the second line makes it executable
once installed, simply run:
php-module-builder
After you have installed the missing modules for php8.4 like apcu, igbinary, imagick, lua and redis, you can run the migrationstep with
php-updater 8.3 8.4
(asuming php8.3 as your “old” php version)
As long as there is no official Nextcloud support for php8.4, this is probably more of a developer thing.
You can easily switch back and forth between the different installed php versions with
php-updater --switch-version
This table lists which modules are involved:
(last [email protected])
Module | 8.0 | 8.1 | 8.2 | 8.3 | 8.4 | php-module-builder |
amqp | ||||||
apcu | ||||||
ast | ||||||
bcmath | ||||||
bz2 | ||||||
cgi | ||||||
cli | ||||||
common | ||||||
curl | ||||||
dba | ||||||
decimal | ||||||
dev | ||||||
dio | ||||||
ds | ||||||
enchant | ||||||
excimer | ||||||
facedetect | ||||||
fpm | ||||||
gd | ||||||
gearman | ||||||
gmagick | ||||||
gmp | ||||||
gnupg | ||||||
grpc | ||||||
http | ||||||
igbinary | ||||||
imagick | ||||||
imap | ||||||
inotify | ||||||
interbase | ||||||
intl | ||||||
ldap | ||||||
libvirt-php | ||||||
lua | ||||||
lz4 | ||||||
mailparse | ||||||
maxminddb | ||||||
mbstring | ||||||
mcrypt | ||||||
memcache | ||||||
memcached | ||||||
mongodb | ||||||
msgpack | ||||||
mysql | ||||||
oauth | ||||||
odbc | ||||||
opcache | ||||||
pcov | ||||||
pgsql | ||||||
phalcon5 | ||||||
phpdbg | ||||||
pinba | ||||||
propro | ||||||
protobuf | ||||||
ps | ||||||
pspell | ||||||
psr | ||||||
raphf | ||||||
rdkafka | ||||||
readline | ||||||
redis | ||||||
rrd | ||||||
smbclient | ||||||
snmp | ||||||
soap | ||||||
solr | ||||||
sqlite3 | ||||||
ssh2 | ||||||
stomp | ||||||
swoole | ||||||
sybase | ||||||
tideways | ||||||
tidy | ||||||
uopz | ||||||
uploadprogress | ||||||
uuid | ||||||
vips | ||||||
xdebug | ||||||
xhprof | ||||||
xml | ||||||
xmlrpc | ||||||
xsl | ||||||
yac | ||||||
yaml | ||||||
zip | ||||||
zmq | ||||||
zstd |
lua module for File Actions app:
This tool is helpful if you want to make use of the File Actions-files_scripts
21 app, which relies on the Lua module that always has to be built.
Example call, to create php8.3-lua module:
php-module-builder 8.3 lua
It can only build one module per call. So if you need three modules, you will have to run it three times, one for every single module.
Happy hacking! Much and good luck,
Please login or Register to submit your answer