skip to Main Content

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:

enter image description here

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

enter image description here

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


  1. Chosen as BEST ANSWER

    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:

    ; On windows:
    extension_dir = "C:xamppphp-8.1.0ext"
    

    This setting only seems important on Windows. Set that line the way you want it, restart apache and you should be good to go!


  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search