dsideal2015 2013-01-10 06:36
浏览 39

htaccess与python和php [关闭]

I have python and php scripts on my web.

The problem is that, python scripts are run correctly but PHP, instead of displayed, is downloaded. It is funny that not all PHP is downloaded, and you can prevent downloading by inserting /? in the end of php script name.

Here is the content of my .htaccess:

Options Indexes Includes ExecCGI
Options +ExecCGI

AddHandler cgi-script .py

DirectoryIndex code.py/

And... the setting is, this .htaccess is placed on the root /www. The PHP scripts is on the other directory let say /php.

Please help. How to let run the PHP correctly.

  • 写回答

1条回答 默认 最新

  • donglei2288 2013-01-10 07:16
    关注

    You need a handler for php. Something along the lines of:

    AddHandler php-cgi .php
    

    depending on what handler should be executing the php scripts (could also be php5-fastcgi)

    评论

报告相同问题?

悬赏问题

  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题