Linux下连接Oracle数据库提示“could not find driver”

浏览:2529 发布日期:2015/11/23 分类:技术分享 关键字: Linux Oracle 数据库
用的TP3.2.3,在Windows下同样的代码没问题,部署到Linux服务器后一直提示“could not find driver”,Linux服务器已安装oci8扩展并在php.ini中添加了oci8.so,模型定义代码如下:class WarnModel extends Model {
    protected $trueTableName = 'T_BJ_WARN';
    protected $connection = array(
            'db_type' => 'oracle',
            'db_user' => 'user',
            'db_pwd' => 'pwd',
            'db_host' => '102.207.130.3',
            'db_port' => '1521',
            'db_name' => 'scjyfxss',
            'db_charset' => 'utf8',
            );
}
然后我用D('Warn')方法实例化模型,然后就一直报错:could not find driver
错误位置
FILE: /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Db/Driver.class.php  LINE: 109
TRACE
#0 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Db/Driver.class.php(109): E('could not find ...')
#1 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Db/Driver.class.php(1075): Think\Db\Driver->connect()
#2 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Db/Driver.class.php(140): Think\Db\Driver->initConnect(false)
#3 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Db/Driver/Oracle.class.php(102): Think\Db\Driver->query('select a.column...')
#4 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Model.class.php(134): Think\Db\Driver\Oracle->getFields('T_BJ_WARN')
#5 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Model.class.php(122): Think\Model->flush()
#6 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Model.class.php(1454): Think\Model->_checkTableInfo()
#7 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Model.class.php(97): Think\Model->db(0, Array, true)
#8 /opt/lampp/htdocs/App/ThinkPHP/Common/functions.php(588): Think\Model->__construct('Warn')
#9 /opt/lampp/htdocs/App/Application/Home/Controller/AlarmDataController.class.php(13): D('Warn')
#10 [internal function]: Home\Controller\AlarmDataController->getAlarmData('chashan', '', '', '', 1, 100)
#11 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/App.class.php(171): ReflectionMethod->invokeArgs(Object(Home\Controller\AlarmDataController), Array)
#12 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/App.class.php(110): Think\App::invokeAction(Object(Home\Controller\AlarmDataController), 'getAlarmData')
#13 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/App.class.php(204): Think\App::exec()
#14 /opt/lampp/htdocs/App/ThinkPHP/Library/Think/Think.class.php(120): Think\App::run()
#15 /opt/lampp/htdocs/App/ThinkPHP/ThinkPHP.php(97): Think\Think::start()
#16 /opt/lampp/htdocs/App/index.php(24): require('/opt/lampp/htdo...')
#17 {main}
搞大半天了都没解决,求问是什么原因呀?
最佳答案
评论( 相关
后面还有条评论,点击查看>>