检测自己的php是否可以访问mysql,以及“Class 'MySQLi' not found”的解决方法

来源:互联网 发布:淘宝小众男装店铺推荐 编辑:程序博客网 时间:2024/06/08 00:19

一、

<?phpif (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {    echo 'We don\'t have mysqli!\n';} else {    echo 'Oh yeah, we have it!';}?>

二、解决“Class 'MySQLi' not found”

博主用的ubuntu15.04,直接sudo apt-get php5-mysql 就ok了。



0 0