Home  >  Article  >  Backend Development  >  PHP connection Oracle configuration under windows

PHP connection Oracle configuration under windows

不言
不言Original
2018-04-13 09:32:492307browse

The content of this article is to share with you about the configuration of php connection to Oracle under windows. Friends in need can refer to it

configuration of php connection to Oracle 11g under windows


System

windows8 server 64


PHP integrated environment

Wampserver2.2


Steps

1. Configure Oracle client to this machine System environment


Download 64 from "http://www.oracle.com/technetwork/topics/winx64soft-089540.html"

bit file "instantclient-basic-windows.x64-11.2.0.3.0.zip" and extract it to a directory, such as c:\windows\instantclient_11_2;

Add the directory "c:\windows\instantclient_11_2" To the system environment variable Path, it is best to add it to the front


2. Restart the system


3. Enable php extension and restart apache

php_oci8_11g

php_pdo_oci //-->If you use pdo to connect

Check the output information and confirm that the oci8 extension is enabled


##4. Use script to test the link

oci_connect(your_username, your_password, "localhost/orcl.168.1.2");


##Note:

1. First configure Oracle's system environment variables and restart the system. If you enable the PHP extension configuration first, an error message such as oci.dll not found will be prompted.

2. If the connection prompts that PATH is not configured and it cannot be solved after restarting, please check the user permissions. It is best to configure it with admin. If it still does not work, directly install the client "win64_11gR2_client" , (approximately more than 600 megabytes)

Related recommendations:

How to connect PHP to mysql-mysqli and PDO

How to implement PHP connection to SQL Server2008 on Windows platform

How to use PHP to connect to the database to implement the message board function

The above is the detailed content of PHP connection Oracle configuration under windows. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn