I’ve been making upgrades on my Dev workstation using XAMPP for a long time now, from the various version 7s up through 8.012.
I seem to have hit a wall upgrading to 8.1.
I’ve edited the apache config to use the new version of php. Taking the php.ini-development
and renaming it to php.ini
, then uncommenting the openssl extension has no effect after I restart apache:
extension=openssl
Openssl isn’t enabled in the php info page:
And if I try and enable mongodb by moving my extension over from the previous installation, and uncomment the extension in php.ini
and restarting apache again I get an error:
extension=php_mongodb.dll
Update: I now find that enabling ANY PHP module does not work under PHP 8.1.
I can roll back to the previous version of php-8.0.12
and have a fully functioning php again. When I roll back to the previous version enabling and disabling PHP modules still works. It does not work under PHP 8.1.
I’d like to stay up to date with the latest release if at all possible!
What am I doing wrong with this version of PHP? Why can’t I enable anything?
2
Answers
I've had to set the FULL PATH to the extensions directory on Windows. Once I did that and restarted, I was able to enable / disable extensions. Look for this line in
php.ini
and adjust it to your needs:This setting only seems important on Windows. Set that line the way you want it, restart apache and you should be good to go!
You are copying an incompatible module compiled with the older version. If you are upgrading the PHP version, You’ll need an extension DLL file compiled with that specific version of PHP and suitable for your server environment. You can download the compatible packages from here PECL. Download and put the .dll file in your extension directory. Then, you’ll need to enable that extension.
Here is the guide for the windows system Installing a PHP extension on Windows.
For MongoDB, get it here https://pecl.php.net/package/mongodb