我使用 PHP、Mysql 和 Codeignater 版本 3 创建了一个网站。然后将其托管在 iPage 上。当我实时上传时,我会更改配置文件。
$db['default'] = array(
'dsn' => '',
'hostname' => '66.96.147.118',
'username' => 'bit_root',
'password' => 'root',
'database' => 'bit_shilp',
'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
);
我使用 codeignater 版本 3。在本地它运行良好。但是在现场它给出了一个错误。
请查看此链接 http://bitshilp.com/BitShilp/index.php/home
它给出了这样的错误:
A PHP Error was encountered
Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Connection refused
Filename: mysqli/mysqli_driver.php
Line Number: 161
Backtrace:
File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/application/controllers/Home.php Line: 7 Function: __construct
File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php Line: 292 Function: require_once A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/system/core/Exceptions.php:272)
Filename: core/Common.php
Line Number: 568
Backtrace:
File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/application/controllers/Home.php Line: 7 Function: __construct
File: /hermes/bosnaweb13a/b2582/ipg.bitshilpcom/BitShilp/index.php Line: 292 Function: require_once
谢谢。
最佳答案
如果 MySQL 服务器已启动并正在运行 - 那么这看起来像是一些传输(例如防火墙)问题。第一步是尝试下面的 telnet 命令 - 如果它显示错误,则问题与 PHP 或 MySQL 无关:
telnet 66.96.147.118 3306
(成功会打印mysql版本+一些随机字符)
关于php - mysqli::real_connect(): (HY000/2002): 实时连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32919571/