jscjso wrote
- all my scripts and data files are in htdocs directory and its subdirectories.
That is what I do not want in a secure system, because all the scripts can be called directly. Even the ones that should only be included by another script. Calling an "inclusion" script directly can lead to a few problems:
- The script could actually do something, like re-initializing a database or cleaning up an error log.
- The script may lack references to other code and fail with all too clear error messages. If you are unlucky, contents of variables and queries could be shown. Very useful to hackers!
- You should be able to control what can be called from outside and what is only for internal use.
So my site has most code outside of the web root. In fact, the web root itself contains little more than calls to the code outside the web root. For my setup, see
http://www.howtoforge.org/set-up-a-modular-svn-repository-for-php-websites
The above story also reveals another security consideration: Error showing should always be set to maximum teasing and nit-picking on development machines, and set to silent on production servers.
This means that on a production server the errors must not
show. They should be logged, send to the developer or whatever.