I am migrating an older application from PHP 7.0 to 8.1 on an ubuntu system. The app is using a library called MobileDetect. The readme of the latest verion of the library which I migrated to, states compatability only for PHP >=7.3,<8.0
As it is a lightweight library I was still hoping to be able to use it with php 8.1, however even the class call is failing:
Executing file:
require_once '../app_global/Mobile_Detect.php';
$detect = new Mobile_Detect;
File Mobile_Detect.php:
<?php
namespace Detection;
use BadMethodCallException;
class Mobile_Detect
{
...
PHP error log:
PHP Fatal error: Uncaught Error: Class "Mobile_Detect" not found in
/home/www/project/qry_index.inc:11\nStack trace...
The name space seems right, there is no capital letter misspelling, so why is the class not found?