[英]Getting server error 500
I am getting an error 500, and when I check the logs on GoDaddy, it am getting below error: 我收到一个错误500,当我检查GoDaddy上的日志时,它出现以下错误:
PHP Fatal error: Class 'CI_DB_mysqli_result' not found in /home/rahmanhabib1/public_html/portal/system/database/DB_driver.php on line 706 PHP致命错误:在第706行的/home/rahmanhabib1/public_html/portal/system/database/DB_driver.php中找不到类'CI_DB_mysqli_result'
and when I go to DB_Driver.php on line 706, 当我在第706行转到DB_Driver.php时,
// Load and instantiate the result driver
$driver = $this->load_rdriver();
$RES = new $driver($this);
also the DB driver settings for my database are set to mysqli, and hosting with GoDaddy. 我数据库的数据库驱动程序设置也设置为mysqli,并通过GoDaddy托管。 Can't seem to find the issue as when I run it on local host, everything seems to be fine. 似乎找不到问题,因为当我在本地主机上运行它时,一切似乎都很好。
Check your apache error logs,try changing your .htaccess to 检查您的Apache错误日志,尝试将.htaccess更改为
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
OR 要么
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
Actually there is no any fault with DB_driver.php
. 实际上, DB_driver.php
没有任何错误。
You may using Codeigniter V2. 您可以使用Codeigniter V2。 So in Codeigniter V2 they use database driver is MySQL
. 因此在Codeigniter V2中,他们使用的数据库驱动程序是MySQL
。 So if you use mysqli
it will end up with this error. 因此,如果您使用mysqli
,它将最终出现此错误。
If you want change MySQL
to mysqli
, follow method as below 如果要将MySQL
更改为mysqli
,请按照以下方法进行操作
1. In config/database.php
1.在config/database.php
Change 更改
$db['default']['dbdriver'] = 'mysql';
to 至
$db['default']['dbdriver'] = 'mysqli';
2. In system/database/DB_driver.php
2.在system/database/DB_driver.php
Change 更改
var $dbdriver = 'mysql';
to 至
var $dbdriver = 'mysqli';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.