为 Apache cgi 启用 scl python27

Enable scl python27 for Apache cgi

我有一个用 Python 编写的 .cgi 脚本需要 python 2.7 但 CentOS 6 没有。我是通过scl安装的。

我在 /etc/profile.d

下创建了 python27.sh
#!/bin/bash

source /opt/rh/python27/enable

虽然这对普通用户有效,但显然 cgi 脚本仍会调用 /usr/bin/python。我怎样才能使 cgi 脚本调用 python27?

尝试:

#!/usr/bin/scl enable python27 -- python