dave5398 wrote:I have just leased a virtual server
Which kind of virtual server, a real one, or a "fake" virtual server which is really a shared (non-virtual) server just sold as a virtual server?
I want to put my scripts at a higher level than the publicly accessible directory
They will not be able to be run from the web if you do so. Are these CLI scripts designed to be run interactively or from cron?
(1) Where is the open_basedir option set if not in the php.ini file?
Either in some other php.ini file or set in an Apache config file (if you're using Apache).
(2) Can I set it using ini_set?
You can't override it if it's set already.
(3) Am I right anyway to want to put my scripts in a higher level directory (because they contain my MySQL username and password in clear text)? Or is there another way to protect that information?
That is not a reasonable method of doing this.
Normal procedure is to store the application configuration in a single file, which contains define()s with the passwords etc in it.
This file could be placed in a directory under the web root called "include", and will be called config.php. Because of the .php extension, the web server will not serve the file directly to the public anyway.
As another security measure, I typically put
Deny From All
In the .htaccess in this "include/" directory. This doesn't affect PHP's ability to include() or require() files from there, but will prevent the web server accidentally serving any files in there, even in the event of another configuration error.
If it's a shared server, there is nothing you can do to secure it - get a proper dedicated server instead.
Mark