+ Reply to Thread
Results 1 to 4 of 4

Thread: Security: where to put PHP and MySQL Files

  1. #1
    grsubs48 is offline x10Hosting Member grsubs48 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    10

    Security: where to put PHP and MySQL Files

    As part of my learning curve I'm attemting to set up a mysql db the long way round by writing the PHP code. For security reasons, in which part of the folder tree should the php file and the mysql file be stored?

    Also, I assume my way of running the php file would be by using a link on one of my web pages. However, if I can click those links then so could anyone else visiting my site. What is the orthodox method of protecting this sort of updating? Should I , or indeed is it possible, to create a link to a section which requires a password, thereby resticting access to such sensitive areas?

    All help much appreciated.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Security: where to put PHP and MySQL Files

    Is this on a server other than x10hosting's free servers?

    What are you doing in the PHP file? Updates, maintenance, etc? Do you want to be able to run it from the Web, but nobody else? Run it from a cron job?
    Nothing is always absolutely so.

  3. #3
    grsubs48 is offline x10Hosting Member grsubs48 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    10

    Re: Security: where to put PHP and MySQL Files

    Thanks for your reply.

    Quote Originally Posted by descalzo View Post
    Is this on a server other than x10hosting's free servers?
    This is on the x10hosting's free servers.

    Quote Originally Posted by descalzo View Post
    What are you doing in the PHP file? Updates, maintenance, etc? Do you want to be able to run it from the Web, but nobody else? Run it from a cron job?
    I'm doing everything: creating the db, creating the tables, might attempt a direct import from excel or may initialy format the input lines in excel and copy the code then I would likely just do the additional maintenance in an input form using php.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Security: where to put PHP and MySQL Files

    For DB administration, use phpMyAdmin, which is accessible from cPanel.

    If you need to perform tasks at a higher level (site admin, webapp), you can password protect folders using cPanel. This uses HTTP Basic authentication, which sends authentication tokens as plaintext. To prevent eavesdropping attacks, use HTTPS (which requires a paid or VPS account, as the free accounts no longer offer a shared SSL certificate) or manually set up digest authentication. Digest authentication still has its weaknesses, but it's not as bad as Basic.

    You can handle authentication & authorization at the app level (e.g. using PHP), but unless you know what you're doing or use an auth package written by people who know what they're doing, your scheme will likely be less secure than any of the above.
    Last edited by misson; 08-26-2011 at 06:02 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. account suspended, mysql chat, want files
    By yoeper24 in forum Free Hosting
    Replies: 3
    Last Post: 01-20-2011, 08:16 PM
  2. noob mySQL security question...
    By dandanthepizzaman in forum Programming Help
    Replies: 5
    Last Post: 07-14-2008, 07:11 AM
  3. PHP + MySQL CMS system for files
    By gamerdude in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 05-27-2008, 04:48 PM
  4. Replies: 0
    Last Post: 03-18-2008, 12:47 AM
  5. Small Security Suggestion Regarding MySQL
    By noner in forum Feedback and Suggestions
    Replies: 9
    Last Post: 11-27-2007, 03:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers