问题描述
我只是更改我的服务器,我有以下错误:
致命错误:调用未定义的函数mysqli_init /home/blacktwitter/public_html/system/database/drivers/mysqli/mysqli_driver.php on line 126
遇到PHP错误
严重性:警告
消息:无法修改头信息 - 头文件已经发送(输出开始于/home/blacktwitter/public_html/system/database/drivers/mysqli/mysqli_driver.php:126)
文件名:core / Common.php
行号:564
Backtrace:
遇到PHP错误
严重性:错误
消息:调用未定义的函数mysqli_init()
文件名:mysqli / mysqli_driver.php
行号:126
Backtrace:
网站在codeigniter。它在一个服务器上的工作和在本地机器上。但当我上传那个网站在新的服务器,我有这些错误。当然我改变重要的参数,如数据库连接,base_url()等。
我对数据库可疑,但我创建数据库和用户等,并更改连接信息网站。
有人知道为什么会发生这种情况吗?这将有助于知道它是在服务器或网站上的错误。另外,当我创建一些index.html与一些测试代码一切都很好。
这不是你的应用程序中的错误,它只是一个缺少的驱动程序,
转到您的php init并取消注释以下内容:
extension = php_mysqli.dll
如果没有,请尝试在您的服务器上安装它,
尝试安装 php5-mysqlnd
你不能通过托管限制,然后只是移动到mysql驱动程序(不需要改变其他配置或查询在CodeIgniter或任何其他...)
像这样您的配置文件)
$ db ['default'] ['dbdriver'] ='mysql'; (您现在可能有mysqli)
i just change my server and i have this errors below:
Fatal error: Call to undefined function mysqli_init() in /home/blacktwitter/public_html/system/database/drivers/mysqli/mysqli_driver.php on line 126
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/blacktwitter/public_html/system/database/drivers/mysqli/mysqli_driver.php:126)
Filename: core/Common.php
Line Number: 564
Backtrace:
A PHP Error was encountered
Severity: Error
Message: Call to undefined function mysqli_init()
Filename: mysqli/mysqli_driver.php
Line Number: 126
Backtrace:
Website is in codeigniter. It's work on one server very well and on local machine too. But when i upload that website on new server i have that errors. Of course i change important parameters like database connection, base_url() etc.
I was suspicious about database, but I was create database and user etc, and change connection info to website.
Is anyone have idea why is this happen? It will be helpful to know is it bug on server or on the website. Also when i create some index.html with some test code everything is fine.
It is not a bug in your application, it is just a missing driver, so, you have couple of options...
Go to your php init and uncomment the following:
extension=php_mysqli.dll
If not, try installing it at your server, it varies depending on your distribution.
Try installing php5-mysqlnd
If you cannot do it by hosting restrictions then just move to mysql driver (wont need to change other configurations or queries in CodeIgniter or anything else...)
like this (at your config file)
$db['default']['dbdriver'] = 'mysql'; (you might have mysqli now)
这篇关于Codeigniter:致命错误调用未定义的函数mysqli_init()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!