Jump to content

[SOLVED] Can someone steal my PHP script?


lokie538

Recommended Posts

Hi,

 

Im new to php and im wondering if anyone can see my php files, more importantly the code? All the files on my website are .php's and I am concerned that my code will be stolen? is this possible? or do they need ftp access to gain access to the code?

 

Thanks in advance,

lokie538 :D

Link to comment
https://forums.phpfreaks.com/topic/102695-solved-can-someone-steal-my-php-script/
Share on other sites

If all your files end with .php nobody can see the code as PHP will automatically parse the file and return the html output.

 

There was an issue when people used to use .inc as the file extension for includes. If this page is requested directly PHP won't parse it and the contents of the file would be displayed as plain text.

No one can see the actual PHP, unless you print or echo it out, or some of the following:

 

- Save the file incorrectly (Examples: .txt,.html,.htm,.phps,.inc)

- Use a .htaccess file to force the php to be displayed as text

 

to make it more secure, DO NOT place the PHP file in the web root directory (or its sub folders), place it outside of the directory, you can still link to them an run them from php scripts in the directory, but you cannot access them from a web browser, or the command line.

to make it more secure, DO NOT place the PHP file in the web root directory (or its sub folders), place it outside of the directory, you can still link to them an run them from php scripts in the directory, but you cannot access them from a web browser, or the command line.

 

Hi, what do u mean place it outside the root directory?? do you mean just put it in a sub folder or something? or do u mean place the .php files outside the directory the public is loading from and just use a include file code and link it into a different directory?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.