問題描述
是否可以在服務器上隱藏 .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.
這篇關于任何人都可以訪問我的 PHP 源代碼嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!