php7没有oci8,需要安装配置,php7安装oci8扩展的方法是:1、下载并安装“oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm”;2、添加环境变量;3、在php官网直接搜oci8;4、通过“pecl install oci8”命令安装oci8即可。
本教程操作环境:centos7系统、PHP7版、Dell G3电脑。
php7没有php oci8吗?
需要安装配置。
php7 安装扩展-oci8 步骤方法:
1. 基础环境
环境:centos7 PHP 7.2.24
2. oracle客户端
2.1 官方地址
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
使用的最新的版本-Version 19.5.0.0.0 ,两个都必须安装,devel版本就是SDK
oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm oracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm
2.2 安装
rpm -ivh oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpm rpm -ivh oracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm
安装完成后默认路径–/usr/lib/oracle/19.5/client64,我没有添加环境变量,如果有需要,根据自己配置添加。
vim /etc/profile source /etc/profile
3. oci8扩展
网上文章安装比较混乱,去php官网直接搜oci8就会出现结果;
3.1 安装
我采取的第一种方法,pecl install oci8;安装过程总会出现Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] :根据官方说明输入客户端路径地址就可以:instantclient,/usr/lib/oracle/19.5/client64/lib
3.2 检查
安装完成后使用–php -m ,检查是否安装成功,进入目录–/usr/lib64/php/modules ,查看是否存在–oci8.so ;
重启之后如果不成功,可以在 /etc/php.ini文件中,添加扩展—extension=oci8.so 。
3.3 重启php-fpm
推荐学习:《PHP视频教程》
以上是php7没有php oci8吗的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

Dreamweaver Mac版
视觉化网页开发工具