EDIT: Looks like I could have saved myself some time & typing: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290932
Looks like PHP 8.4 does not like pecl_mcrypt 1.0.7.
This is both ports and binary packages, so PHP 8.4.13 (quarterly packages) and PHP 8.4.15 (ports) on FreeBSD 13.5 and 14.3.
One line of code is enough to trigger the error:
The ports version is 1.0.7 and there's a specific 1.0.9 version that is PHP 8.4 compatible:
pecl.php.net
The comment for the new version: "Make changes to how the extension uses random, to make it work with PHP 8.4 (and PHP 8.5)."
1.0.9 has the FreeBSD patch file in it, so that patch file can be removed.
To fix (I've just checked I can stop the error message appearing so far; I'll do a bit more testing for my use case):
In /usr/ports/security/pecl-mcrypt change Makefile to 1.0.9:
Then:
Is anyone else seeing this? Is the suggested set of changes "good"? And yes, I know I need to move this legacy code to openssl or libsodium (current workaround is phpseclib).
Looks like PHP 8.4 does not like pecl_mcrypt 1.0.7.
This is both ports and binary packages, so PHP 8.4.13 (quarterly packages) and PHP 8.4.15 (ports) on FreeBSD 13.5 and 14.3.
One line of code is enough to trigger the error:
Code:
$iv=mcrypt_create_iv(32,MCRYPT_RAND);
Code:
ld-elf.so.1: /usr/local/lib/php/20240924/mcrypt.so: Undefined symbol "php_rand"
The ports version is 1.0.7 and there's a specific 1.0.9 version that is PHP 8.4 compatible:
PECL :: Package :: mcrypt 1.0.9
The comment for the new version: "Make changes to how the extension uses random, to make it work with PHP 8.4 (and PHP 8.5)."
1.0.9 has the FreeBSD patch file in it, so that patch file can be removed.
To fix (I've just checked I can stop the error message appearing so far; I'll do a bit more testing for my use case):
In /usr/ports/security/pecl-mcrypt change Makefile to 1.0.9:
Code:
PORTVERSION= 1.0.9
Then:
Code:
# make makesum
# rm files/patch-php84
# make install
Is anyone else seeing this? Is the suggested set of changes "good"? And yes, I know I need to move this legacy code to openssl or libsodium (current workaround is phpseclib).