TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Tips & Tricks (http://www.talkphp.com/tips-tricks/)
-   -   How to protect your php files & database if PHP fails! (http://www.talkphp.com/tips-tricks/4729-how-protect-your-php-files-database-if-php-fails.html)

Sam Granger 07-13-2009 09:11 PM

How to protect your php files & database if PHP fails!
 
On occasion, I'll come across a PHP powered site, some are popular, some are sites that I am visiting for a first time. But what I'm talking about here is when PHP is down on a server. This gives people access to your whole sourcecode - maybe you can protect some files with htaccess (just have index in root, all config files etc... in a folder with htaccess protection so you can't download the files - I haven't tried this but I'm pretty positive it will work), but another method is to place all important PHP files below the root. A lot of people forget that this is possible, and it's a nice secure way to protect your application and your userbase/database. It may be a small tip but if you want to protect your code & database details, this is a good method. ^^

ETbyrne 07-13-2009 10:21 PM

I'm thinking if PHP fails then just hit the power button, because something has gone terribly wrong with your server.

Sam Granger 07-13-2009 10:59 PM

Quote:

Originally Posted by ETbyrne (Post 26971)
I'm thinking if PHP fails then just hit the power button, because something has gone terribly wrong with your server.

Indeed - but you can't always do this immediately when it happens. It's just a precaution.

rguy84 07-14-2009 06:02 AM

If PHP hits a bug and PHP isn't rendered, it won't be displayed... Sometimes firefox gives you the php tags... But I don't know what the point you are wanting to make. Cause if you put your functions two directories deep, and PHP fails and the php tags are shown, you will get:
PHP Code:

<?php
 
include('/path/to/file.php'); ?>

so you're SOL anyhow. If somebody really wants to grab your stuff, there are (or used to be) extensions that stop the php from executing. Then the only thing you can do is hope you chmod'ed that directory.

Sam Granger 07-14-2009 12:25 PM

Crap, I always forget about chmod!

AxelG 02-18-2012 08:07 PM

I use ionCube encoder to hide my PHP code.


All times are GMT. The time now is 09:59 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0