Many issues encountered by remote Oracle under local Windows PHP connection

Source: Internet
Author: User

Mission Purpose: Under local Windows PHP connects to Oracle under the remote server.

You must determine the database version of the server, which can cause many errors if the local driver and the server version are inconsistent.

The known Oracle version is divided into 32-bit 10g,11g,13g 64-bit 10g,11g,13g

My machine is a 64-bit system, began to go into the misunderstanding, all versions of the 64-bit download, the result no matter how you tune, the local driver is not found OB method.

Then target to 32-bit, 32 if download the wrong version, will report this error.

Oci_connect (): Ocienvnlscreate () failed. There is something wrong with your system-please check this PATH includes the directory with Oracle Instant Client Libra Ries

After finding the right version, download it down and run it successfully.

One of my local due to the new open, so many configuration files are not, resulting in the process of the implementation of the lack of various files, according to the missing files to the official website (authoritative point of the website) to download, put to the location can.

The following are the steps:

1. Open the php.ini and open the Extension=php_oci8.dll.

2. Which download the Oci.dll room in Oracle package to the C-drive sys32? 64 See how many bits your own system is.

3. Copy all the files in the Oracle package to a copy of the PHP extension folder, one copy of Apache's Bin directory.

If still not the extension of PHP Php_oci8.dll also put in a sys32, this is not sure, check a lot of information so that I put in the first.

Which changed a lot of environmental variables what, the final problem after the discovery of all use, and all deleted.

Finally, attach the code for PHP to connect to Oracle (where the SID in Oci_connect is a commonly-used database, but it seems to be universally called a service name in Oracle, you just understand it as a database name).

$conn = Oci_connect ('username','Password',"(description= (address= (PROTOCOL =tcp) (host=192.168.0.180) (PORT = 1521)) (Connect_data = (SID=TOPLW) ))"); $sql="select * FROM table"; $ora _test= Oci_parse ($conn, $sql);//Compiling SQL statementsOci_execute ($ora _test,oci_default); //ExecutionEcho"<pre>"; while($r =oci_fetch_row ($ora _test))//Retrieving results{print_r ($r);}

Many issues encountered by remote Oracle under local Windows PHP connection

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.