summaryrefslogtreecommitdiff
path: root/includes/database.mysql.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/database.mysql.inc')
-rw-r--r--includes/database.mysql.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index 7b307a3c5..8f96dc3bb 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -21,6 +21,15 @@
* (e.g. your database and web server live on different machines).
*/
function db_connect($url) {
+ // Check if MySQL support is present in PHP
+ if (!function_exists('mysql_connect')) {
+ drupal_maintenance_theme();
+ drupal_set_title('PHP MySQL support not enabled');
+ print theme('maintenance_page', '<p>We were unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your <code>PHP.ini</code> to see how you can enable it.</p>
+<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+ exit;
+ }
+
$url = parse_url($url);
// Allow for non-standard MySQL port.