【发布时间】:2016-04-14 04:51:55
【问题描述】:
我是 codeigniter 3.0 的新手。我正在将我的项目上传到我的服务器上。但我面临一些困扰我的错误。但它在本地运行良好。我用谷歌搜索但没有找到我的答案。我认为存在一些数据库配置问题。
这是我的数据库.php
$db['default'] = array(
'dsn' => '',
'hostname' => 'http://selectomobile.com/freber',
'username' => 'my username',
'password' => 'mypassword',
'database' => 'mydatabasename',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
有些错误让我很恼火。
1.
遇到 PHP 错误 严重性:警告 消息:mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known 文件名:mysqli/mysqli_driver.php 行号:161 回溯: 文件:/home/selectom/public_html/freber/index.php 线路:292 函数:require_once
2.
遇到 PHP 错误 严重性:警告 消息:mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known 文件名:mysqli/mysqli_driver.php 行号:161 回溯: 文件:/home/selectom/public_html/freber/index.php 线路:292 函数:require_once
3.
遇到 PHP 错误 严重性:警告 消息:无法修改标头信息 - 标头已发送(输出开始于 /home/selectom/public_html/freber/system/core/Exceptions.php:272) 文件名:core/Common.php 行号:568 回溯: 文件:/home/selectom/public_html/freber/index.php 线路:292 函数:require_once
4.
发生数据库错误 无法使用提供的设置连接到您的数据库服务器。 文件名:core/CodeIgniter.php 行号:500
【问题讨论】:
-
我只是运行 [link] (selectomobile.com/freber)。
-
如果服务器上有 cPanel,请查看那里的 mysql 服务器地址。这不是您的网站/应用程序链接。也可以在phpmyadmin中查看,或者如果您没有安装cPanel,您可以将其设置为
localhost或安装MySQL的服务器的IP地址。
标签: php codeigniter mysqli codeigniter-3