Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 440 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Unable to connect Php5.3 with Oracle 11gR2 on NetBeans 7.4

Issue:-
=====
on "tnsping service_name" getting an error "Failed to resolve the name"
Environment:-
===========
->OS Name Microsoft Windows 7 Enterprise
Version 6.1.7601 Service Pack 1 Build 7601
->PHP 5.3 & tried with 5.4
->Oracle 11gR2
->NetBeans 7.4
->Oracle instant client 11_2 32 bit & tried with 64 bit as well
->Xampp server 1.8 & tried with lower version also.
->path location of instant client : C:\Windows\SysWOW64
->environment variable: C:\Windows\SysWOW64\instantclient_11_2
Troubleshooting:-
========
-> tried to do tnsping with service name and alias name also, getting failed to resolve name.
-> port 1521 is listening.
-> firewall is turned off.
-> tried to change the port from 1521 to 1527 but getting same error.
-> checked the registry and found correct entries for tns_admin and oracle_home.
-> tried to change the service name as well, no success.
-> changed the sid name to service name in tnsnames.ora file, no success.
-> restarted the listener service several times, no success.
-> system is rebooted various times after setting environmental vaiable for instant client.
-> localhost is resolved by 127.0.0.1 IP.
-> checked the trace file of tnsping, found nothing special.
-> checked the log file of tnssping and found following error:-
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
TNS-00512: Address already in use
64-bit Windows Error: 48: Unknown error
Please help, we are struggling with this issue since last two weeks, and we are in mid of our project.
Thanks in advance.
Prince Kumar
Citrix R&D
Answers
-
I see a few issues or potential issues:
1. Using Windows. If your application will eventually be deployed on Linux, then you really need to develop it on Linux due to various differences in the way PHP works on the platforms. It's also commonly suggested that PHP is slower on Windows. There are also issues with some important PHP extensions on Windows. If you don't have a native Linux machine, then use https://www.virtualbox.org/ to create a VM.
2. Using a tnsnames.ora file. Why not use the Easy Connect connection string format "hostname/servicename" that doesn't require any local configuration file? This removes one point of failure because you don't have issues making sure Oracle libraries can locate and read the tnames.ora file. (For the syntax, see PHP: oci_connect - Manual or my book The Underground PHP and Oracle Manual)
3. Nothing in your question involves PHP or Netbeans. Since tnsping fails, you have a basic network or Oracle client installation issue. This needs to be resolved first, before looking at PHP (though make sure to use the correct 32 or 64 bit as required by Xampp). See the next point for what I suspect is the problem.
4. Your list mentions Oracle 11.2 and Instant Client as separate items. If you already have a DB on the machine, then you don't need Instant Client (unless there are 32 vs 64 bit issues). Having multiple sets of Oracle libraries on Windows is a common source of user errors due to library clashes. Clean up the machine and check connection using SQL*Plus from the DB home.
5. In the last few months Windows PECL extensions have become more easily accessible from http://pecl.php.net extension pages, so the need for bundles like Xampp has decreased. It might be easier to install Apache and PHP separately. See http://www.oracle.com/technetwork/articles/dsl/inst-php-apache-windows-098333.html
-
Warning: oci_connect() [function.oci-connect]: ORA-12541: TNS:no listener
how can i solve this problem??