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条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改