Originally posted by theDog
Don't take me for any sort of expert, but i think if you have access to your php.ini you can define a default include directory away from your document root.
For example, '/usr/local/lib/php' is a BSD default location. I keep some things in "../somedir" ---nobody's going to read them there. Of course, I own* the server, and can put stuff where I like. However, on those sites I've worked on in the past on ProHosters and the like, we always had access to at least one level below the Apache DocumentRoot. Put your stuff there...apache won't let anyone read it. If they CAN get to it somehow, you're busted anyway...hope they're just out for fun and don't have a sadistic streak.......
Else, yeah, that's what i do is put them in a pass-protected directory. And i try to make my own error messages for the really critical files because while i might be paranoid, i don't think anyone needs to know the full paths to my include files, or my db name or login, as default errors are apt to tell them.
🙂
Good doggy!! 😃Have a scooby-snack....
Suppression of error reporting is wise on any well-trafficked site, particularly if you do "real-time development." Of course, on a "well-trafficked" site, you should probably do your development in private, anyway. 😉 You can even use mail() to send the errors to yourself, instead of displaying anything at all. That seems superior to, say, pulling up your webserver log every time you forget to close a bracket 😉