用oracle配置php [英] configure php with oracle

查看:66
本文介绍了用oracle配置php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从PHP连接到oracle.我下载了php_oci8.dll库,将其放在php的ext目录中,在我的php.ini文件中定义了extension=php_oci8.dll,然后重新启动了Web服务器. 我收到一条错误消息,说Call to undefined function oci_connect().我发现php需要使用--with-oci8=path_to_library配置.查看php配置(phpinfo())时,它在配置命令"部分显示--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared.

i want to connect to oracle from PHP. I downloaded the php_oci8.dll library, put it in the ext directory of php, defined extension=php_oci8.dll in my php.ini file and restarted the web server. I get an error saying Call to undefined function oci_connect(). I found out that php needs to be configured with --with-oci8=path_to_library. Looking to the php configuration ( phpinfo() ) there it says --with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared in the "configure command" section.

我正在Windows 7计算机上运行.

I am running on a windows 7 machine.

我该如何更改?为了使它正常工作,我还必须做些什么?

How can I change that ? And what else must I do to get it work ?

谢谢!

推荐答案

仅在您要将库直接编译到PHP中时,--with才可用.如果添加'extension'参数没有加载oracle库,请检查您是否修改了正确的php.ini.或列出了.dll的正确路径.

The --with stuff is only if you want to compile a library directly into PHP. If adding the 'extension' argument didn't load the oracle library, then check that you modified the correct php.ini. Or had the correct path listed for the .dll.

通常有两个php.ini.一种用于Web服务器操作,另一种用于命令行.

There's usually two php.ini's. One for webserver operations, and one for command line.

您可以使用phpinfo()查看当前配置.如果Oracle扩展程序已加载,则会在其中列出配置选项的部分.

You can see what the current configuration is with phpinfo(). If the Oracle extension's loaded, there'll be a section with its config options listed.

这篇关于用oracle配置php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆