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 6576641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:32:16+00:00 2026-05-25T15:32:16+00:00

This is my application environment: Redhat 6.0 Apache 2.2 Django 1.3.0 Python 2.6.6 cx_Oracle

  • 0

This is my application environment:

Redhat 6.0
Apache 2.2
Django 1.3.0
Python 2.6.6
cx_Oracle 5.1
mod_wsgi 3.2
Oracle DBMS 11.2 (on a different machine)

Issue:
accessing my django website from a web browser fails because cx_Oracle can’t acquire Oracle handle.

Tests:

  1. running django-admin.py shell to query the db DOES WORK (running from a bash session with ORACLE_HOME and LD_LIBRARY_PATH vars set)
  2. running a custom script that adds ORACLE_HOME and LD_LIBRARY_PATH to os.environ and uses cx_Oracle to connect to DB, without using django DOES WORK (running from a bash session with ORACLE_HOME and LD_LIBRARY_PATH vars set)
  3. running the same custom script with “sudo -u apache” does NOT work
  4. running the same custom script with “sudo -u env ORACLE_HOME=foo LD_LIBRARY_PATH=foo myscript.py” DOES WORK
  5. modifying django.db.backends.oracle.base.py so that, before the Database.connect statement, I have os.environ printed to a file, SHOWS I HAVE ORACLE_HOME AND LD_LIBRARY_PATH CORRECTLY SET
  6. explicitly setting ORACLE_HOME and LD_LIBRARY_PATH in os.environment inside adhoc django wsgi.py script DOES NOT WORK
  7. restarting httpd with “sudo env ORACLE_HOME=foo LD_LIBRARY_PATH=foo /etc/init.d/httpd restart” DOES WORK

My question is: why is test 7 different from tests 2, 5, 6? To put it another way, why do I have to pass env vars to parent httpd process instead of just setting them in python/django scripts?

  • 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-25T15:32:17+00:00Added an answer on May 25, 2026 at 3:32 pm

    The LD_LIBRARY_PATH must be in the environment prior to a process being executed. The process runtime loader will only read it once at startup, changing the value of the environment after the process has been started makes no difference. This is just how things work.

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

Sidebar

Related Questions

I have a VB6's Application that is in production environment right now, this application
I have a ClickOnce environment like this: \\Fileserver\ClickOnceApps\App1.application C:\Documents and Settings\user\Start Menu\Programs\publisher\app1.appref-ms My understanding
This issue has come up three times in our environment. After installing the ClickOnce
This is in a web application environment: An initial request is able to successfully
I've made this application in a Windows environment. In eclipse, I made an executable
We currently have an web application running on IIS6 on a 32bit machine. This
This application is using windows integrated authentication in IIS. No anonymous login. It's also
I have this application I'm developing in JSP and I wish to export some
I'm working on this application that's sort of like a blog. I'm thinking about
i have this application but how to use its? and example for 7-zip can?

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.