Two versions of PHP installed, Elgg does not detect the enabled one

I have a small ubuntu server at home, and I have two versions of PHP:

  • 8.1 (Disabled)
  • 8.2 (Active and enabled)

Other PHP frameworks detect the correct version, however Elgg does not:

your composer dependencies require a php version = 8.2.0

https://i.imghippo.com/files/H7765YE.jpeg

Is there something I am missing?

  • Have you checked that your webserver configuration points to the correct PHP version? If you enable `allow_phpinfo` in the settings.php you can go to http://yoursite/phpinfo, there you can see the path to the PHP executable.

    You can also check in the server PATH to which PHP version it points, also on the command line you can type `which php` which will point you to the 'default' PHP version.

    If that is not the correct one, make some configuration changes.

  • And don't forget about php-cli:

    update-alternatives --set php /usr/bin/php8.2

    where /usr/bin/php8.2 is PATH to your PHP binary as Jerome suggested

  • Hi!

    None of the suggestions worked, may be because I am using an OrangePi as a server.

    I removed one and just running 8.2 and working as expected. Might be server related or elgg related (since Laravel and Symfony had no issues)