Security PHP script, inline or other

I'm interested in PHP security on an HTML page where the PHP code is embedded (a web page that exists on the server as "webpage.php") or a PHP script that can be linked to HTML code (i.e. a PHP script, which is not actually part of the webpage existing on the server as "something.php" and refers to "webpage.html"). Suppose that if the source code of my PHP script is known to someone, this will be a very big problem. I know that when you look at the source of a PHP page in a browser, the PHP script is not displayed, but what if the PHP server failed and the HTML is still loaded (maybe this is possible), could the user see the PHP script? To be more general, is there any possible way for a user to access the source PHP script from a web browser, and if so,then how to prevent it?

+3
source share
2 answers

What if the PHP server failed and the HTML is still loaded (is this possible), can the user see the PHP script?

Security holes aside, this usually happens when someone messes with the server or transfers the site to servers and PHP files, is unloaded into a folder that is not configured to run PHP. This is the price you pay to deploy PHP, as simple as deleting files in a folder.

, PHP, , (, ) PHP, - (, URL /, htdocs). , .

( , , , .)

+4

, , - HTML, PHP, ( , "htdocs" )). , , , , .

+2

Source: https://habr.com/ru/post/1742023/


All Articles