• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

PHP accessible directories outside httpdocs

C

ComTech

Guest
Is it possible to create PHP accessible directories outside httpdocs?

For example, I need to setup a directory to store configuration files that cannot be accessed directly.

Creating a password protected sub directory in httpdocs might work but I would really rather not do it this way.
 
There's a couple of ways to handle this

1. Make your PHP files somewhere on the server and call them via the command line using /usr/bin/php command and then entering the path to your PHP script. This is more useful for Crontab jobs really.

2. Put your files into the tmp directory (it's in the same directory as httpdocs) and call them via include. Files in that directory cannot be accessed via the web server.
 
Does the tmp directory get cleared out systematically? Basically another directory just like tmp is what I would like to create. Typically i name this directory config and store files that get included in my PHP scripts there.
 
Not that I know of. The /tmp directory is provided so that you have a directory outside httpdocs that you can put files in (none of the other directories in the root of your FTP is owned by you, the FTP user).
 
Use the following configuration in apache config:

php_admin_value open_basedir "/tmp:/any_other_path"
 
Back
Top