thinkphp5.1 连接oracle
1. 安装TP5.1的orclae扩展
composer require topthink/think-oracle=v2.1
2. 在项目wendor -> topthink -> think-oracle中
将Builder.php和Connection.php分别放到:\thinkphp\library\think\db对应的builder和connector目录并都改名为Oracle.php;
且修改两个Oracle.php 文件中命名空间分别为
namespace think\db\builder; 和 namespace think\db\connector;
类名 改为
Oracle
如下图
图1
图2
oracle 连接配置如下
正式项目使用
3. phpstudy 中php.ini中开启扩展
extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
extension=php_pdo_oci.dll
4. 重新启动phpstudy
5. phpinfo中看到
最后连接查询数据成功了,谢谢各位大佬有问题请指出哈。。。