简体   繁体   English

将PHP连接到Oracle数据库

[英]Connecting php to oracle database

I am trying to connect to a oracle database that is not installed locally but i am getting a lot of errors. 我试图连接到未在本地安装的oracle数据库,但出现很多错误。 I had windows 8 and easyphp installed , I unchecked extensions for oracle connection(php_oci8, and the other one, similar to this) but i received the message: 我安装了Windows 8和easyphp,未检查oracle连接的扩展名(php_oci8,另一个与此类似),但收到消息:

Call to undefined function oci_connect().

and when i start php it gives me an error 当我启动PHP时,它给了我一个错误

The procedure entry point OCILobRead2 could not be located in the dynamic link library ...php_oci8.dll

Then after reading some on the internet i saw that i have to install oracle database or oracle instantclient. 然后,在互联网上阅读一些内容之后,我看到我必须安装oracle数据库或oracle Instantclient。 Installed both, oracle database 11g2 didn't work( i guess it's because of my windows 8), oracle database 12 did install but then i couldn't do anything and i still have the message. 两者都安装了,oracle数据库11g2无法正常工作(我猜是因为我的Windows 8),oracle数据库12确实安装了,但是后来我什么也做不了,但我仍然收到消息。 Then, before installing i find an online document that suggested installing xamp 1.7.3 and oracle instant client. 然后,在安装之前,我发现一个在线文档,建议安装xamp 1.7.3和oracle Instant Client。 Did so, set my enviroment path to instant client but still nothing happened...still getting the same errors as above. 这样做了,将我的环境路径设置为即时客户端,但是仍然没有任何反应...仍然出现与上述相同的错误。

Also tried another functions like ocilogon(which is depreciated) but i receive the same error.Any help would be apreciated. 还尝试了类似ocilogon(已贬值)的其他功能,但我收到相同的错误。任何帮助都会被贬低。

You need to make sure that in your PHP directory you have php_oci8.dll for your version of PHP and then make sure it's listed in your php.ini file. 您需要确保在您的PHP目录中具有php_oci8.dll于您的PHP版本的php_oci8.dll ,然后确保该文件已列在php.ini文件中。 There's also an important note on the PHP site about this. 在PHP网站上也有关于此的重要说明。 http://www.php.net/manual/en/oci8.requirements.php http://www.php.net/manual/en/oci8.requirements.php

On Windows, the php_oci8 DLL needs Oracle client libraries from version 10gR2 or greater. 在Windows上,php_oci8 DLL需要版本10gR2或更高版本的Oracle客户端库。 In PHP 5.3 up to and including PHP 5.3.5, the php_oci8_11g DLL requires Oracle 11gR1 or greater client libraries. 在PHP 5.3及以下版本(包括PHP 5.3.5)中,php_oci8_11g DLL需要Oracle 11gR1或更高版本的客户端库。 From PHP 5.3.6 the php_oci8_11g DLL requires Oracle 11gR2 or greater client libraries. 从PHP 5.3.6开始,php_oci8_11g DLL需要Oracle 11gR2或更高版本的客户端库。 The php_oci8_12c DLL from PECL requires Oracle 12cR1 client libraries. PECL中的php_oci8_12c DLL需要Oracle 12cR1客户端库。 With some versions of Instant Client you may additionally need mfc71.dll and msvcr71.dll libraries. 对于某些版本的Instant Client,您可能还需要mfc71.dll和msvcr71.dll库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM