Step-by-Step Guide
Update Package List
First, ensure that your package list is up-to-date.
sudo apt-get update
Install php-mysqli Extension
Install the php-mysqli extension for PHP 7.4.
sudo apt-get install php7.4-mysqli
Verify Installation
After installation, you should verify that the extension is enabled. You can do this by creating a PHP info file.
sudo nano /var/www/html/info.php
Add the following content to the file:
php
Copy code
<?php
phpinfo();
?>
Save and close the file. Then, navigate to http://your-ec2-instance-public-dns/info.php in your web browser and check for mysqli in the output.
Restart Apache
Restart Apache to apply the changes.
sudo systemctl restart apache2
0 More Answers