Enabling the MySQLi Extension in PHP 7
In PHP 7, the MySQLi extension provides improved MySQL database connectivity functionality. However, users may encounter issues with enabling this extension on Ubuntu 14.04. This article provides a step-by-step solution to successfully enable MySQLi in PHP 7.
Verifying Installed Extensions
To check if the MySQLi extension is installed, run the following command:
sudo apt-cache search php7-*
If MySQLi is not listed among the output, proceed with the following steps:
Updating Apache and PHP 7
The default PHP package for MySQL connectivity (php5-mysql) is deprecated. To resolve this, install the newer package:
sudo apt-get install php-mysql
This command will automatically update Apache and PHP 7.
Restarting Apache
After installing the new package, restart Apache to apply the changes:
sudo service apache2 restart
Verifying MySQLi Extension
Once Apache has restarted, use phpinfo() to verify that the MySQLi extension is now enabled:
Troubleshooting
If the MySQLi extension is still not enabled, check the following:
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3