PHP 7 cannot find MySQLi
<p>For some reason, Windows 7 is unable to find the MySQL install. I've tried quite a few things to little or no avail. </p>

<p>I want to connect to my MySQL database with php using this code:</p>

<pre><code>$con = new mysqli($server_name,$mysql_user,$mysql_pass,$db_name);
if($con-&gt;connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error;
}
else{
    echo "&lt;h3&gt; Database Connected &lt;h3&gt;";
}
</code></pre>

<p>When I do connect, I receive this error message:</p>

<blockquote>
  <p>Fatal error: Uncaught Error: Class 'mysqli' not found in C:\Apache\htdocs\test_connection.php:8 Stack trace: #0 {main} thrown in C:\Apache\htdocs\test_connection.php on line 8</p>
</blockquote>

<p>I ran this code and it returns that I don't have <code>mysqli</code> loaded:</p>

<pre><code>if (!function_exists('mysqli_init') &amp;&amp; !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!! ';
} else {
    echo 'Phew we have it!';
}
</code></pre>

<p>I have added</p>

<pre><code>extension_dir = "C:\php\ext"
</code></pre>

<p>and</p>

<pre><code>extension=php_mysqli.dll 
</code></pre>

<p>to both <code>php.ini-development</code> and <code>php.ini-production</code></p>

<p>I have my extensions in </p>

<pre><code>C:\php\ext
</code></pre>

<p>and I also have the <code>php_mysqli.dll</code> file in that folder.</p>

<p>I have added the following code to the end of my httpd.exe file in Apache</p>

<pre><code>LoadModule php7_module "c:/php/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "c:/php"
</code></pre>