Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux、Windows 打开 PHP oci8模块连接Oracle #2

Open
wilon opened this issue Jan 3, 2017 · 0 comments
Open

Linux、Windows 打开 PHP oci8模块连接Oracle #2

wilon opened this issue Jan 3, 2017 · 0 comments
Labels

Comments

@wilon
Copy link
Owner

wilon commented Jan 3, 2017

坑太多,有条件的直接试用docker吧。

PHP是通过 oci8 扩展连 Oracle instantclient 操作 Oracle的,他们之间版本都得对上;

Windows 打开 PHP oci8 模块?

  • 下载32位Oracle-instantclient,别管系统PHP是x86;
    官方地址例:http://download.oracle.com/otn/nt/instantclient/10205/instantclient-basic-win64-10.2.0.5.zip
  • 解压到【c:\xxxx】并加到环境变量path
  • 下载对应PHP版本的oci8扩展,php.ini 开启扩展
    在phpinfo里查找对应的:x86 还是 x64 ; NTS 还是 TS
  • 重启测试;

Linux 打开 PHP oci8 模块?

cd 【源码包】/
/【PHPBIN】/phpize 
./configure --with-php-config=/【PHPBIN】/php-config --with-oci8=instantclient,/usr/lib/oracle/【版本】/client【位数】/lib/
make && make install
  • 根据提示,将安装好的 oci8.so 加入到 php.ini
  • 重启测试;
@wilon wilon closed this as completed Jan 3, 2017
@wilon wilon changed the title Oracle php instantclient download. PHP连接Oracle踩过的坑 Jan 3, 2017
@wilon wilon modified the milestone: 置顶 Jan 3, 2017
@wilon wilon reopened this Jan 3, 2017
@wilon wilon changed the title PHP连接Oracle踩过的坑 Linux、Windows 打开 PHP oci8模块连接Oracle Jan 3, 2017
@wilon wilon added the php label Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant