简体   繁体   English

如何用xampp连接oracle数据库?

[英]how to connect oracle database with xampp?

I download the XAMPP Windows 1.8.2 and oracle instant client 12.1.我下载了 XAMPP Windows 1.8.2 和 oracle 即时客户端 12.1。

Then, I unzip the oracle instant client file, edit the PATH environment setting, and edit PATH in the System variables list by adding instant client's path.然后,我解压 oracle 即时客户端文件,编辑 PATH 环境设置,并通过添加即时客户端的路径在系统变量列表中编辑PATH

I find string ;extension=php_oci8.dll. Remove the semicolon (;) from the begining of the string to activate the oracle extension and save it.我找到string ;extension=php_oci8.dll. Remove the semicolon (;) from the begining of the string to activate the oracle extension and save it. string ;extension=php_oci8.dll. Remove the semicolon (;) from the begining of the string to activate the oracle extension and save it.

Then I restart xampp but I cannot find oci8 in phpinfo.然后我重新启动 xampp 但在 phpinfo 中找不到 oci8。

Please help me to save the problem.请帮我解决问题。

Now check in php_info();现在检查 php_info(); that oci8 enables or not if enable then use standard oci8 connections oci8 是否启用,如果启用,则使用标准 oci8 连接

This is your standard Oracle connection这是您的标准 Oracle 连接

 include('database.php'); //which have database credentials and server name stored

  $c = oci_connect($userName, $password, "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =$serverName)(PORT = 1521)))(CONNECT_DATA=(SID=$databaseName)))");

print_r($c);

Try this尝试这个

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

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