doushi8187 2010-06-23 02:20
浏览 48
已采纳

如果PHP处理器脱机,有没有办法阻止PHP文件服务?

Which is the question my partner said I'd not need answering, so to prove my point I removed php and simulated a server problem. And hey presto, the webserver serves up the PHP source as a download.

So, the question, is there a way to stop source being served up in the event of a server glitch, bug, or temporary loss of connection to the relevant modules etc?

  • 写回答

3条回答 默认 最新

  • dongyong1942 2010-06-23 02:29
    关注

    The only way source is revealed is if you change the server configuration by error – for instance, you're using a mod_php for Apache and accidentally remove the module.

    For that particular case, you can do this:

    <IfModule php5_module>
       AddHandler php5-script .php
       PHPIniDir "/etc"
    </IfModule>
    <IfModule !php5_module>
      <FilesMatch "\.php$">
          Order allow,deny
          Deny from all
          Satisfy All
      </FilesMatch>
    </IfModule>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 kali环境运行volatility分析android内存文件,缺profile
  • ¥15 写uniapp时遇到的问题
  • ¥15 vs 2008 安装遇到问题
  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率
  • ¥15 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线