Commented: (MODPYTHON-225) Allow Python executable location
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Commented: (MODPYTHON-225) Allow Python executable location




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Commented: (MODPYTHON-225) Allow Python executable location  
Graham Dumpleton (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-29-07 06:13 AM


[ https://issues.apache.org/jira/brow...action_12509002 ]

Graham Dumpleton commented on MODPYTHON-225:
--------------------------------------------

When doing this, changes should be made to testhandler to display the variou
s settings, eg sys.executable, in some way.

> Allow Python executable location and Python home to be specified.
> -----------------------------------------------------------------
>
>                 Key: MODPYTHON-225
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-225
>             Project: mod_python
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 3.3.1
>            Reporter: Graham Dumpleton
>
> Where a user has multiple versions of Python installed getting mod_python 
to work can be problematic.
> The main issue is where a version of Python is installed in a location different t
o where the standard operating system version is installed. For example, if /usr/bin
/python is Python version 2.4 and a user has installed Python version 2.5 as /usr/lo
cal
/bin/python. And the user has compiled mod_python against Python 2.5 and not the operating s
ystem version 2.4.
> Under normal circumstances Apache is only going to look in /usr/bin when started f
rom an init.d script and not in /usr/local/bin. The result of this is that Python wh
en initialised will find /usr/bin/python and assume that that is the base it should 
use
to start with to find where the Python library files are installed. In doing
 this though it will not be able to find /usr/lib/python2.5 as what it reall
y needs to be able to find is /usr/local/lib/python2.5. The final outcome wi
ll be that mod_python will
not be able to find the Python code files for itself when starting up.
> The only way around this is to set the PATH environment variable in the startup sc
ripts for Apache to look in /usr/local/bin before /usr/bin. Alternatively, on some U
NIX platforms (but not necessarily all) it is possible to set the environment variab
le
PYTHONEXECUTABLE to be the exact location of the Python executable specified
 when configuring mod_python. Finally, on UNIX platforms one can also set PY
THONHOME to be the exact location of either a shared platform independent/de
pendent Python library dire
ctory, or where separate directories a colon separated list of the two directories. In the l
atter Python will skip the whole search process and simply use the two values.
> Having to use environment variables to do this can be a pain as it may be necessar
y to modify init.d startup scripts to make it work. What should really be done is th
at mod_python should provide for UNIX platforms the directives PythonExecutable and 
Pyt
honHome as equivalents to using the PYTHONEXECUTABLE and PYTHONHOME environment variables. T
hese values if defined can be used in calls to Py_SetProgramName() and Py_SetPythonHome() ap
propriately.
> This will allow the Apache configuration file itself to be used to qualify
 which version of Python should be used when non standard versions not in th
e standard locations are being used.
> Note that these directives shouldn't be required on the Windows platform as it use
s the Windows registry to find where the Python library files are located.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:50 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register