Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 352403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:44:02+00:00 2026-05-12T11:44:02+00:00

Hello and thanks to everyone for reading my question. I’ve been working on a

  • 0

Hello and thanks to everyone for reading my question.

I’ve been working on a PHP web program for a little while and was wondering what measures should I take to protect the source before putting it on a live server. The source isn’t being distributed, it’s being accessed through a website (users log into the website to use it).

First I’d like to protect the source php files from being found and downloaded. I’m not using any framework, just php and all files are in the home directory as index.php. I read around and it seems that robots.txt isn’t really effective for hiding. I came across some posts of people recommending .htaccess, but I often thought it was for protecting files within a directory with a password, so not sure if there’s a way to make it htaccess suitable for a web app.

Second, I’d like to protect the source files in the case someone gets access to them (either finds them and downloads them or a sys admin that has ready access to the server). I thought of source encryption with something like ioncube. My host also has GnuPG [which I’m not familiar with, any thoughts about it compared to ioncube?]

I’m not familiar with source protection, so any ideas would be nice, and of course thank you muchly 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:44:02+00:00Added an answer on May 12, 2026 at 11:44 am

    Just make sure your web server is set up to handle .php files correctly, and that all files have the correct .php extension (not .php.inc or similar)

    As long as your server executes the PHP, no one can download its source code (ignoring any security holes in your code, which is a different topic)

    There was a time when it was common to name included files along the lines of mystuff.php.inc – this is a bad idea. Say your site is at “example.com”, and you store your database configuration in config.php.inc – if someone guesses this URL, they can request http://example.com/config.php.inc and get your database login in plain text..

    It is a good idea to store configuration and other libraries up one directory as bisko answered – so you have a directory structure like..

    /var/example.com:
        include/
            config.php
            helper_blah.php
        webroot/
            index.php
            view.php
    

    This way, even if your web-server config gets screwed up, and starts serving .php files as plain text, it’ll be bad, but at least you wont be announcing your database details to the world..

    As for encrypting the files, I don’t think this is a good idea.. The files must be unencrypted to Apache (or whatever server you’re using) can access them. If Apache can access it, your sysadmin can too..

    I don’t think encryption is the solution to an untrustworthy sysadmin..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone and thanks for reading... I'm a Mono / Web developer and was
Hello everyone and thanks in advance for reading this.. I have the following html
Hello everyone and thanks for reading. For means of QA, I want to setup
Hello everyone and thanks for viewing this question :) I am an indie to-be-developer
hello everyone I'm working with Eclipse under Windows XP, but I can't find there
Hello everyone it is me again with another question. The booking system located here
Introduction : Hello Everyone, I have been looking for days for a way to
Hello everyone and thanks for helping me. I made this calculator in C# and
Hello everyone it's been some days that I use sql to make analysis and
Hello everyone I am new to the forum and I just had a question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.