1. Check your current PHP version:
php -v
2. Install the MySQL module for the correct PHP version:
sudo apt install php8.4-mysql php8.3-mysql php8.2-mysql
3. Enable the MySQLi extension:
sudo phpenmod -v 8.4 mysqli
sudo phpenmod -v 8.3 mysqli
sudo phpenmod -v 8.2 mysqli
4. Restart Apache:
sudo systemctl restart apache2
5. Verify that the module is loaded:
php -m | grep mysqli
---
This should fix the "Call to undefined function mysqli_connect()" error. Let me know if you need more help!