TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-13-2009, 09:11 PM   #1 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default 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.
Sam Granger is offline  
Reply With Quote
Old 07-13-2009, 10:21 PM   #2 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

I'm thinking if PHP fails then just hit the power button, because something has gone terribly wrong with your server.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 07-13-2009, 10:59 PM   #3 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Quote:
Originally Posted by ETbyrne View Post
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.
Sam Granger is offline  
Reply With Quote
Old 07-14-2009, 06:02 AM   #4 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default

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.
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Old 07-14-2009, 12:25 PM   #5 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Crap, I always forget about chmod!
Sam Granger is offline  
Reply With Quote
Old 02-18-2012, 08:07 PM   #6 (permalink)
The Wanderer
 
AxelG's Avatar
 
Join Date: Feb 2012
Posts: 16
Thanks: 0
AxelG is on a distinguished road
Default

I use ionCube encoder to hide my PHP code.
AxelG is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Injection and mysql_real_escape_string Durux General 61 01-29-2013 12:20 PM
How use PHP to read image files from a folder and display them in Flex 3 tilelist. chunL Absolute Beginners 12 07-13-2009 01:49 AM
[Tutorial] How to organize your classes | Part 1 Tanax Advanced PHP Programming 10 03-01-2009 10:08 PM
Tips: PHP security Village Idiot Tips & Tricks 22 11-23-2007 11:17 PM
Uploading Files with PHP daz Absolute Beginners 3 09-30-2007 06:23 PM


All times are GMT. The time now is 05:43 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design