Solved PHP83 installed over PHP73 as part of upgrade to FreeBSD-13.2 - Now cannot find libraries

I am getting these errors thrown by PHP83 when testing Squirrelmail:
Code:
# cat /var/log/php_errors.log
[24-Jan-2024 20:24:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'session.so' (tried: /usr/local/lib/php/20210902/session.so (Cannot open "/usr/local/lib/php/20210902/session.so"), /usr/local/lib/php/20210902/session.so.so (Cannot open "/usr/local/lib/php/20210902/session.so.so")) in Unknown on line 0

[24-Jan-2024 20:24:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'gettext.so' (tried: /usr/local/lib/php/20210902/gettext.so (Cannot open "/usr/local/lib/php/20210902/gettext.so"), /usr/local/lib/php/20210902/gettext.so.so (Cannot open "/usr/local/lib/php/20210902/gettext.so.so")) in Unknown on line 0

[24-Jan-2024 20:24:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/local/lib/php/20210902/mbstring.so (Cannot open "/usr/local/lib/php/20210902/mbstring.so"), /usr/local/lib/php/20210902/mbstring.so.so (Cannot open "/usr/local/lib/php/20210902/mbstring.so.so")) in Unknown on line 0

[24-Jan-2024 20:24:29 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'xml.so' (tried: /usr/local/lib/php/20210902/xml.so (Cannot open "/usr/local/lib/php/20210902/xml.so"), /usr/local/lib/php/20210902/xml.so.so (Cannot open "/usr/local/lib/php/20210902/xml.so.so")) in Unknown on line 0

The following packages are installed:
Code:
pkg info -x php
mod_php81-8.1.27
php83-8.3.1
php83-gettext-8.3.1
php83-mbstring-8.3.1
php83-session-8.3.1
php83-xml-8.3.1
squirrelmail-abook_import_export-plugin-php83-1.1_2
squirrelmail-calendar_file_backend-plugin-php83-1.0_3
squirrelmail-compatibility-plugin-php83-2.0.16_1
squirrelmail-php83-20230207
squirrelmail-plugins-php83-1.0_2
squirrelmail-shared_calendars-plugin-php83-2.0.1_3
squirrelmail-vlogin-plugin-php83-3.10.2_2

Code:
php -i
phpinfo()
PHP Version => 8.3.1

System => FreeBSD webmail-1.hamilton.harte-lyne.ca 13.2-RELEASE-p8 FreeBSD 13.2-RELEASE-p8 GENERIC amd64
Build Date => Jan  6 2024 01:31:03
Build System => FreeBSD 132amd64-quarterly-job-10 13.2-RELEASE-p9 FreeBSD 13.2-RELEASE-p9 amd64
Configure Command =>  './configure'  '--disable-all' '--program-prefix=' '--with-config-file-scan-dir=/usr/local/etc/php' '--with-layout=GNU' '--with-libxml' '--with-openssl' '--with-password-argon2=/usr/local' '--enable-dtrace' '--enable-embed' '--enable-fpm' '--with-fpm-group=www' '--with-fpm-user=www' '--enable-mysqlnd' '--with-external-pcre=/usr/local' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd13.2' 'build_alias=amd64-portbld-freebsd13.2' 'PKG_CONFIG=pkgconf' 'PKG_CONFIG_LIBDIR=/wrkdirs/usr/ports/lang/php83/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig' 'CFLAGS=-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing ' 'LDFLAGS= -L/usr/lib -lcrypto -lssl -fstack-protector-strong ' 'CPP=cpp' 'CXXFLAGS=-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include ' 'OPENSSL_CFLAGS=-I/usr/include' 'OPENSSL_LIBS=-L/usr/lib -lssl -lcrypto'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc
Loaded Configuration File => /usr/local/etc/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php
Additional .ini files parsed => /usr/local/etc/php/ext-18-session.ini,
/usr/local/etc/php/ext-20-gettext.ini,
/usr/local/etc/php/ext-20-mbstring.ini,
/usr/local/etc/php/ext-20-xml.ini

PHP API => 20230831
PHP Extension => 20230831
Zend Extension => 420230831
Zend Extension Build => API420230831,NTS
PHP Extension Build => API20230831,NTS

I infer from the path
Code:
/usr/local/lib/php/20210902/gettext.so
that some artifact from 7.3 is causing php to look in the wrong directory as gettext.so exists in another subdirectory:
Code:
ll /usr/local/lib/php/20230831/gettext.so
-rw-r--r--  1 root  wheel  14160 Jan  6 09:08 /usr/local/lib/php/20230831/gettext.so

Where do I set up PHP to look in
Code:
/usr/local/lib/php/20230831/
?
 
Back
Top