0

I am trying to enable the MySQLi extension in PHP to create a database for my website

$conn = mysqli_connect($servername, $username, $password);

This line of code doesn't run. It throws an error, which has let me down a rabbit hole of trying to enable MySQLi. I have tried editing the php.ini, but have had no success. Take note that there are two php.ini files.

I have tried uncommenting the extension in both files, and then furiously checking in cmd if "php -m" would yield any new results, as in it would display my extension. I have tried removing the ";". I have tried providing absolute paths to any single thing related to the extension that needed a path.

extension_dir="C:\php\ext"

and also

extension="C:/php/ext/php_mysqli.dll" 
extension=mysqli

I would happily reinstall if that meant a fix, but I have already tried that twice, so I am not that hopeful. Thank you for your responses in advance.

Haverka
  • 38
  • 4
  • you need to copy one of the .ini files and rename it to `php.ini` - the two included in the installation are just example files – Optimum Jul 05 '22 at 20:22
  • Create a new PHP file with this code: `` (read more about that here: https://www.php.net/phpinfo) Then visit that file in your browser. It will list your current PHP's configuration, including the php.ini file it's actually using and not the ones you've been trying to modify. – icecub Jul 05 '22 at 20:29

0 Answers0