I have Apache running on OSX Lion and MacPorts Python and some packages installed with MacPorts.
There are some Python cgi scripts that I’d like to run. It looks like Apache uses the Python that is installed with Lion. How can I configure Apache so that the cgi scripts are run with the MacPorts Python and sites-packages (PYTHONPATH I guess)?
Edit /System/Library/LaunchDaemons/org.apache.httpd.plist. After the initial
<dict>tag, add this, setting whatever path you require. Restart Apache.You can use SetEnv in and .htaccess file to set other environment variables, e.g. PYTHONPATH, but SetEnv can’t be used to set the PATH.