致命错误:调用未定义函数mysqli_connect() [英] Fatal error: Call to undefined function mysqli_connect()

查看:591
本文介绍了致命错误:调用未定义函数mysqli_connect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我试图解决这个问题,但不幸的是没有结果。让我告诉你我关于这个问题的故事。我在网站上创建了一个应用程序,应用程序处理评论。但是,我试图把它放在另一个站点上,并且我复制了php文件,旧站点的sql文件,并将它们移动到新站点(它们位于不同的FTP服务器上)。当我试图从应用程序转到页面时,我收到这个致命错误:
$ b

For 2 days now I'm trying to solve this, but unfortunately no result. Let me tell you my story about the problem. I've bulid an application on a site, and the application deals with the reviews. But, I'm trying to put it on another site, and I copyed the php files, the sql file from the old site, and moved them to the new site (they are on different FTP servers). When I'm trying to go to the pages from the application, I receive this FATAL ERROR:


致命错误:调用未定义的函数mysqli_connect ()

Fatal error: Call to undefined function mysqli_connect()

我写的连接数据库的代码是这样的(带有隐藏证书):

The code that I wrote to connect to the database is this (with hidden credentials):

$con = mysqli_connect("","*the_name*","*the_pass*","*the_database*");
if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

为什么我会收到错误?它适用于旧服务器,代码我认为这不是问题,因为它在本地主机上运行,​​而在新服务器上它不工作。任何人都可以帮助我?

Why do I get the error? It works on the old server, and the code I think it's not the problem, because it works on localhost, and on the new server it doesn't. Can anyone help me?

推荐答案

mysqli PHP扩展未安装在您的新服务器上。

The mysqli PHP extension is not installed on your new server.

联系您的服务器管理员。

Contact to your server administrator.

这篇关于致命错误:调用未定义函数mysqli_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆