任何人都可以访问我的 PHP 源代码吗?

2021-12-20 00:00:00 encryption php

是否可以在服务器上隐藏 .php 文件...?

Is it possible to hide the .php file on the server...?

我有一个网站,有时会在 iframe 中调用 php 文件,现在如果有人复制了该代码,我不喜欢它,那么我该如何隐藏它呢?还是我必须加密它?

I have a website which sometimes calls php files inside iframes, now I wouldn't like it if somebody copied that code, so how would I hide it? Or do I have to encrypt it?

速度对我来说是一个大问题,所以任何不影响性能的东西都值得赞赏!

Speed is a huge matter in my case, so anything that doesn't affect performance is appreciated!

谢谢

推荐答案

使用正确配置的 Web 服务器,您的网站访问者看不到 PHP 代码.为了让访问您网站的人可以访问 PHP 代码,必须将服务器配置为将其显示为文本,而不是将其作为 PHP 代码进行处理.

With a correctly configured web server, the PHP code isn't visible to your website visitors. For the PHP code to be accessible by people who visit your website, the server would have to be configured to display it as text instead of processing it as PHP code.

因此,换句话说,如果您访问您的网站并看到一个 HTML 页面而不是 PHP 代码,则您的服务器运行正常,并且没有人可以访问 PHP 代码.

So, in other words, if you visit your website and you see a HTML page and not PHP code, your server is working correctly and no one can get to the PHP code.

相关文章