伙计们。 我已经有几天尝试从php脚本访问MariaDB了,但是没有成功。这是代码(我从w3schools复制了代码)
<?php
$servername = "localhost";
$username = "";
$password = "";
//Se crea la coneccion con la Base de Datos
$conn = new mysqli($servername,$username,$password);
//Se asegura que todo este correcto
function conectar(){
if (mysqli_connect_error()){
die ("Coneccion a Base de Datos fallida: ".mysqli_connect_error());
}
}?>
当我尝试执行它时,结果如下:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysqli.so'- /usr/lib/php/20151012/mysqli.so: undefined symbol: mysqlnd_connect in Unknown on line 0
PHP Fatal error: Uncaught Error: Class 'mysqli' not found in /var/www/html/lisa.php:7
Stack trace:
#0 {main}
thrown in /var/www/html/lisa.php on line 7