PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 15, 2022

[FIXED] Placing the PHP application folder above public_html

 March 15, 2022     directory, lamp, php, security     No comments   

Issue

I saw in a thread and seen in some frameworks, that using the below structure is recommended. Can someone please explain why, in terms of security (if you can explain it thoroughly would be appreciated)? Are there any other advantages of this?

  • root
    • app
      • application_folder
      • config
      • controllers
      • models
    • public_html
      • css
      • js
      • images
      • index.php
      • .htaccess

EDIT:

Does this have any effect if the server was hacked?


Solution

The idea is that only the things that should be able to be accessed by the user are placed in public_html, so that random people on the Internet can't access random pieces of your code or data if they guess the right URL.

The usual way this is done is to have a public folder inside the app which is then symlinked to public_html or under, and not actually split the application in two parts.



Answered By - Amadan
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing