赞
踩
如果您的应用程序不安全,则无法真正避免下载文件.以下示例允许恶意用户查看服务器上的任何文件:
readfile($_GET['file']);
?>
如果你想阻止Apache在PHP出现问题时暴露源代码,请在httpd.conf / .htaccess中添加:
# In case there is no PHP, deny access to php files (for safety)
Order allow,deny
Deny from all
# the following should be added if you want to parse .php and .phtml file as PHP
# .phps will add syntax highlighting to the file when requesting it with a browser
AddType text/html .php .phtml .phps
AddHandler application/x-httpd-php .php .phtml
AddHandler application/x-httpd-php-source .phps
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。