Home  >  Article  >  Backend Development  >  初到php 板块报到,问几个关于安全的初学者级有关问题,恳请各位神牛赐教

初到php 板块报到,问几个关于安全的初学者级有关问题,恳请各位神牛赐教

WBOY
WBOYOriginal
2016-06-13 13:40:48674browse

初到php 板块报到,问几个关于安全的菜鸟级问题,恳请各位神牛赐教!
初到php 板块报到,问几个关于安全的菜鸟级问题,恳请各位神牛赐教!

由于经常要调用某些函数,所以就把它们单独地写出来,集中到一个独立的php 文件。在其它调用到的页面就要required 调用。问题是,
1.这样会不会被其它网站调用?

2.如何禁止直接访问php?

3.文件权限应该怎么设置??
别人访问我的php 通过php 进行操作是算“世界”的“运行”权限么?

------解决方案--------------------
1.不会。除非你的php.ini allow_url_fopen 设置为开放 
2.如何禁止访问php?可以将php文件都放置到web目录外的目录
3.不好意思 没看懂,另外得区分win/linux系统
------解决方案--------------------
1. 如果不是在同一个server上,别人无法require到你的函数,远程include也只能得到你输出的内容,如果都是函数,那就是空白. 而且你可以通过.htaccess或者放到web目录外来防止别人访问

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn