diff --git a/apdqc.install b/apdqc.install
index 9ea3fdb..ba315c8 100644
--- a/apdqc.install
+++ b/apdqc.install
@@ -128,7 +128,6 @@ function apdqc_requirements($phase) {
   $t = get_t();
 
   if ($phase === 'runtime') {
-
     // Only working with MySQL currently.
     $db_type = apdqc_fast_get_db_type();
     if ($db_type !== 'mysql') {
@@ -166,36 +165,54 @@ function apdqc_requirements($phase) {
     }
 
     // Check if mysqlnd is installed.
-    if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
-      $mysqlnd = array();
-      exec('php --modules | grep mysqlnd', $mysqlnd);
-      if (!in_array('mysqlnd', $mysqlnd)) {
+    $mysqlnd = array();
+    if (function_exists('mysqli_get_client_stats')) {
+      $mysqlnd[] = 'mysqlnd';
+    }
+    if (empty($mysqlnd)) {
+      exec('php --modules', $mysqlnd);
+    }
+    if (empty($mysqlnd) && defined('PHP_BINARY') && !empty(PHP_BINARY)) {
+      $php_bin_loc = PHP_BINARY;
+      if (is_executable($php_bin_loc)) {
+        exec($php_bin_loc . ' --modules', $mysqlnd);
+      }
+    }
+    if (empty($mysqlnd) && !empty($_SERVER['PHPRC'])) {
+      $php_bin_loc = $_SERVER['PHPRC'] . DIRECTORY_SEPARATOR . 'php.exe';
+      if (is_executable($php_bin_loc)) {
+        exec($php_bin_loc . ' --modules', $mysqlnd);
+      }
+    }
+
+    // If mysqlnd is not installed, throw an error.
+    if (!empty($mysqlnd) && !in_array('mysqlnd', $mysqlnd)) {
+      $directions = $t('You need to <a href="@url">install the mysqlnd driver</a> on this system.', array('@url' => 'http://php.net/manual/en/mysqlnd.install.php'));
+      if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
         $release_info = array();
         // Get server version.
         exec('ls /etc/*release', $release_info);
         $release_info_string = implode(',', $release_info);
-        $directions = '';
+        $directions .= ' ';
         if (strpos($release_info_string, 'lsb-release') !== FALSE) {
           // PHP 5.4 on ubuntu has php5enmod available.
           if (PHP_VERSION_ID < 50400) {
-            $directions = $t('Run <code>sudo apt-get install php5-mysqlnd && sudo php5enmod mysqlnd<code>');
+            $directions .= $t('Run <code>sudo apt-get install php5-mysqlnd && sudo php5enmod mysqlnd<code>');
           }
           else {
-            $directions = $t('Run <code>sudo apt-get install php5-mysqlnd</code>. You might need to add the extension to your php.ini file as well <code>extension=mysqlnd.so</code>; should be located here: @ini', array('@ini' => php_ini_loaded_file()));
+            $directions .= $t('Run <code>sudo apt-get install php5-mysqlnd</code>. You might need to add the extension to your php.ini file as well <code>extension=mysqlnd.so</code>; should be located here: @ini', array('@ini' => php_ini_loaded_file()));
           }
         }
         elseif (strpos($release_info_string, 'redhat-release') !== FALSE) {
-          $directions = $t('Run <code>sudo yum remove php-mysql && sudo yum install php-mysqlnd</code>. You might need to add the extension to your php.ini file as well <code>extension=mysqlnd.so</code>; should be located here: @ini', array('@ini' => php_ini_loaded_file()));
-        }
-        if (!empty($directions)) {
-          $requirements['apdqc_mysqlnd'] = array(
-            'title' => $t('APDQC'),
-            'value' => $phase === 'install' ? FALSE : $t('The mysqlnd extension is not installed on this server.'),
-            'severity' => REQUIREMENT_ERROR,
-            'description' => $directions,
-          );
+          $directions .= $t('Run <code>sudo yum remove php-mysql && sudo yum install php-mysqlnd</code>. You might need to add the extension to your php.ini file as well <code>extension=mysqlnd.so</code>; should be located here: @ini', array('@ini' => php_ini_loaded_file()));
         }
       }
+      $requirements['apdqc_mysqlnd'] = array(
+        'title' => $t('APDQC'),
+        'value' => $phase === 'install' ? FALSE : $t('The mysqlnd extension is not installed on this server.'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $directions,
+      );
     }
 
     // Check if mysqli async is available.
