在centos 7上运行codeigniter项目时出错

时间:2017-08-23 03:55:17

标签: postgresql codeigniter centos

使用postgre数据库在centos 7上运行codeigniter时出错。错误是:

Fatal error: Uncaught Error: 
  Call to undefined function pg_pconnect() in /var/www/html/mkt/system/database/drivers/postgre/postgre_driver.php:100
Stack trace:
#0 /var/www/html/mkt/system/database/DB_driver.php(116): CI_DB_postgre_driver->db_pconnect()
#1 /var/www/html/mkt/system/database/DB.php(149): CI_DB_driver->initialize()
#2 /var/www/html/mkt/system/core/Loader.php(347): DB(Array, NULL)
#3 /var/www/html/mkt/system/core/Loader.php(1172): CI_Loader->database()
#4 /var/www/html/mkt/system/core/Loader.php(153): CI_Loader->_ci_autoloader()
#5 /var/www/html/mkt/system/core/Controller.php(52): CI_Loader->initialize()
#6 /var/www/html/mkt/application/controllers/report.php(9): CI_Controller->__construct()
#7 /var/www/html/mkt/system/core/CodeIgniter.php(309): Report->__construct()
#8 /var/www/html/mkt/index.php(203): require_once('/var/www/html/m...')
#9 {main} thrown in /var/www/html/mkt/system/database/drivers/postgre/postgre_driver.php on line 100

连接代码是:

$db['default']['hostname'] = '172.17.11.112';
$db['default']['username'] = 'quizdb';
$db['default']['password'] = 'quizdb';
$db['default']['database'] = 'quizdb';
$db['default']['dbdriver'] = 'postgre';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE; 

请帮忙。我已经搜索了这个错误,但无法找到解决方案。

0 个答案:

没有答案