Cgi不执行python
我在让 CGI 适用于 Python 时遇到问题。
我已
Options ExecCGI
AddHandler cgi-script cgi py pl
在 /etc/apache2/sites-available/default 内 添加
现在 Perl 可以工作,但 Python 给出 500 内部服务器错误..
编辑:
如果当前的“默认”文件
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin/">
Options +ExecCGI
AddHandler cgi-script .cgi .py .pl
Allow from all
</Directory>
有什么想法吗?
I'm having a problem getting CGI to work for Python.
I've added
Options ExecCGI
AddHandler cgi-script cgi py pl
inside /etc/apache2/sites-available/default within
and now Perl works, but Python gives out a 500 Internal Server Error..
EDIT:
This if the current 'default' file
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride AuthConfig
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin/">
Options +ExecCGI
AddHandler cgi-script .cgi .py .pl
Allow from all
</Directory>
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将 .py 文件重命名为 .cgi,它对我有用。
Try renaming the .py files to .cgi, it worked for me.
如果可以满足您的需求,请尝试使用 python CGI 服务器而不是 apache。
Try using the python CGI server instead of apache,if that can meet your needs.