Building PHP 8.0 on FreeBSD 15.1

Nextcloud 23, for which an update is long overdue, doesn't support PHP 8.4 which is available on FreeBSD 15.1. The earliest it supports is PHP 8.0. I had upgraded my jails to FreeBSD 15.1 and missed to upgrade Nextcloud and php in locksteps, so we'll have to resolve some issues so we can upgrade Nextcloud and bring it up to support PHP 8.4.

git clone https://git.freebsd.org/ports.git
cd ports/lang/php80
make install clean

LibXML2 was updated and no longer compatible.

pkg remove libxml2
cd ports/textproc/libxml2
make install clean

Went smoothly, but dialog4ports was deprecated long ago, so we'll need that to configure the ports.

cd ports/ports-mgmt/dialog4ports
make install clean

But that fails as libdialog doesn't exist in base FreeBSD (it was deprecated, I suspect it had something to do with remove GPL licensed code).

wget http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/13.2-RELEASE/src.txz
mv src.txz src.tar.xz
unxz src.tar.xz
tar x -vzf src.tar
cd usr/src/gnu/lib/libdialog
make install clean

Now dialog4ports builds fine, and we can configure php80. But perl5 is the wrong version. I tried installing autoconf and automake from repo, but php80-extensions expects autoreconf2.71 (repo has 2.73).

pkg remove perl5
cd ports/lang/perl5.34 # default version for 2023Q4
make install

Now building php80 builds and installs fine. Except that pdo_mysql extension requires libfido2 which fails needing ppoll(). I decided to use packages to install mysql80-client. Now php80-extensions builds and installs fine as well. Here are the extensions required to get occ running.

GD
Zip
Zlib
PDO
# PDO driver for your database
sudo -u www php updater/updater.phar
Update to Nextcloud 23.0.12 available

Once again all is well. Now I need to [[ https://github.com/nextcloud/server/wiki/Releases-and-PHP-versions][upgrade]] to Nexcloud 29 on PHP 8.0, then upgrade php to 8.3 and upgrade to 34. The upgrade process itself has been smooth and thankfully, PHP 8.3 is in the repos for FreeBSD 15.1.

Next up is to move on to Baikal or Radicale for more stability as I only need a {Cal,Card}dav server.