Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6907125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:23:47+00:00 2026-05-27T08:23:47+00:00

Configured a CentOS 5.6 server with Oracle’s 11g XE (the freebie version), installed OCI8

  • 0

Configured a CentOS 5.6 server with Oracle’s 11g XE (the freebie version), installed OCI8 with the help of this guide and got a pre-existing (custom) PHP application communicating with the database with no issues. Called that server Dev and started the next build.

The Prod server that I’m now working on is just like Dev except that Oracle 11G is the Standard edition, not the free version. Everything else, to the very best of my knowledge, identical. Definitely the same OCI RPMs.

Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in
/var/www/html/blah/blah.php

I’m sure I have an “environmental” issue but I can’t figure out how to solve it.

Oracle, Apache, OCI8 and PHP are all on the same box.

What works:

  • tnsping orcl from the Prod server.
  • sqlplus user@orcl from the Prod
    server.
  • phpconfig(); shows all the OCI8 stuff. Compared the results on Dev and Prod and they are identical.
  • I can also connect via Toad from an XP client on the other end of a VPN.

I just can not get PHP to talk to the DB. Driving me mad!

Did a global search on the Prod server, there is only one tnsnames.ora file. Here’s what it looks like:

ORCL = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
) )

Anything I should provide that would help? Just leave a comment.

I really don’t want to flatten and start over on the Prod box… Please help me figure this out!

[edits]
It isn’t finding the listener, I guess. Out of curiosity, I stopped the listener service and confirmed that nothing about the error changes.

By request, here’s some code.

The code that throws the error I mentioned above:

$dbh = OCILogon($vars[oracle_login], $vars[oracle_pwd], $vars[oracle_instance]);

Variables are set in another file:

…

But we can skip that. While copying and pasting them over to here I took a moment to line up parentheses — and found an extra.

Typo!

Doh. /facepalm.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:23:47+00:00Added an answer on May 27, 2026 at 8:23 am

    While fulfilling a request to show some code, I took a moment to format it and line it all up. At that point, I discovered an extra parentheses.

    Fixing that fixed the issue.

    Sorry for all the reading!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just installed and configured mod_python 3.2.8 on a CentOS 5 (Apache 2.2.3) server with
Seen with gdb on openSUSE, CentOS, Fedora, and Ubuntu: This gdb was configured as
I've got a LAMP dev server at something like dev.example.com. Eventually this will be
My CentOS 5.5 server has both Python 2.4 and Python 2.7 installed (to /opt/python2.7.2
I have Postfix 2.3 on Centos 5.5 server. I followed this how to http://wiki.centos.org/HowTos/postfix_sasl
I configured IntelliJ IDEA 6.0.6 to use Subversion for version control. The Subversion menu
I often plug pre-configured lambdas into enumerable methods like 'map', 'select' etc. but the
I've got it configured, but I want more from it...maybe Cygwin isn't the right
I've recently installed mongodb on my CentOS 6 VM running on Vagrant. I added
I've got a very simple java program (J.java, see below) on my application server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.