Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)

I just changed my server and experience these 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 works on one of the server very well and on the local machine too. But when I am uploading to that website at the new server I have that errors. Of course, I have changed important parameters like database connection, base_url() etc.

I was sceptical about the database, but I had created a new database and user etc. and changed the connection info.

Why does this happen? It will be helpful for me to know if it is a bug at the server or at the website. Also when I am creating some index.html with some test code everything is fine.

1 Answer

0 votes
by (12.7k points)
edited by

It is not a bug in your application, it is only a missing driver, so, you have a couple of options.

Head over to your PHP init and then you uncomment the below code:

extension=php_mysqli.dll

If not, do try installing it at your server, it varies depending on your distribution.

Try installing php5-mysqlnd.

If you can't do it by hosting restrictions then simply move to MySQL driver (won't have to change the other configurations or queries in the CodeIgniter or anything else...)

Like this (at your config file)

$db['default']['dbdriver'] = 'mysql'; (you might have mysqli now)

Interested in SQL ? Check out this SQL Certification by Intellipaat. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...