To install the native driver on Linux you would need something like: sudo apt-get install php-mysqlnd Things to double check when initialising the MySQLi Class ![]() This will trigger the installation of MySQLi. If you are running your code on AWS, you can use a command such as: sudo yum install php71-mysqli ![]() If you have used the binary installer and it’s still not working, trying to reinstall PHP to see if it resolves the issue as there could have been a failed installation or configuration that didn’t complete correctly. The MySQLi extension is enabled by default for PHP versions 5.3.0 onwards. On Windows machines you will likely find that you don’t (or haven’t) had to do this manually if you’ve used the binary installer. This can easily be done locally during development by going to the PHP website for MySQLi installation. Check your MySQLi installationĪ common reason for the above error occurring is simply forgetting to install MySQLi. Also double-check all the details you are providing in your parameters. It’s always worth double-checking both the structure of your initialisation code to ensure there are no typos or missing parameters as this is a common cause. $db_name – the database table that you want to access.$db_password – the password for the database user stored in $db_user.$db_user – the username for use with your database (server-wide or database-specific).$db_server – the address to your database server.$mysqli – this is the object where you want the reference to the new MySQLi instance to be stored.Something like: $mysqli = new MySQLi($db_server, $db_user, $db_password, $db_name) You will likely be using a simple bit of code to initialise your MySQLi class. The fundamental issue here is that you’re trying to load a class that isn’t or cannot be found. ![]() Forget for a moment that this is a MySQLi issue and consider that it is actually an issue that you can encounter with any object-orientated programming development. The issue being caused here is that the class, in this case ‘MySQLi’ cannot be initialised. Fatal error: Class 'MySQLi' not found () on line The Issue
0 Comments
Leave a Reply. |