2010-11-04 6 views

Répondre

7
if (extension_loaded('mysqlnd')) // or 'mysql' or 'pdo_*' 
    echo 'MYSQL extension is loaded'; 

vous pouvez également utiliser:

if (function_exists('mysql_connect')) 
    echo 'MYSQL functions are available'; 
2

Enregistrez cela sous (nom non important) et accédez-y via un navigateur Web. Parmi un tas d'autres informations, il vous dira si PHP a été compilé avec MySQL ou non.

<?php 
phpinfo(); 
?> 

Espérons que cela aide.

+0

+1: seule solution donnée qui fonctionne indépendamment de l'API. MySQLi et PDO existent! –

0

Faites ceci en code avec.

if (!function_exists('mysql_connect')) 
{ 
    return 'MySQL not supported by PHP on this server!'; 
} 
0
if (extension_loaded('mysql')) { 
    echo "MySQL Installed"; 
} else { 
    echo "MySQL not installed"; 
} 
Questions connexes