我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在不执行的情况下在Apache上托管PHP文件?

If I host a PHP file on Apache, it will just be executed. I want clients to be able to download the PHP file without changing the .php extension. I don't want to disable PHP either.

if you don't want to play with apache configuration or .htaccess, then use PHP itself to get it done

create a file showcode.php with following code

echo file_get_contents('/path/to/your/php/file/having/viewable/code/for/users/');

近期文章

  • 如何在添加新计划之前检查重复的计划
  • 使用两个表中的条件从一个表中删除Mysql
  • strtotime开始和月末不能正常工作
  • 打开Graph标签不能在WordPress / Codeigniter集成中工作
  • 按名称更新用户输入
  • 可能需要多种类型的函数参数?
  • PHP提取html标签和内容[重复]
  • 加入2个多维数组php?
  • 从减去两次获得十进制数量
  • 从另一个页面中的页面回显类中的字符串?
  • 在php数组中显示单词present而不是日期
  • MySQL获得每个分支的查询总数
  • 使用另一个表中的值更新php MYSQL中的表
  • 如何使用Simple HTML DOM在javascript标记内获取文本
  • 在PHP中格式化数组
  • too long
  • 这是什么类型的CSS?
  • 如何在PHP中翻转日期[重复]
  • PHP向后兼容
  • php反向数组元素

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华