• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

Creating/using a folder outside httpdocs level

W

webguy80

Guest
Hi,

I need to use a web directory *outside* of the document root of httpdocs to use as an include directory for php include files for use in a php application.

I tried using the private directory (there by default), and creating my own directory and assigning the proper permissions etc. Both times I get these types of errors when trying to include inc.config.php from the include directory:

Code:
Warning: main(): open_basedir restriction in effect. File(/var/www/vhosts/domain.com/private/inc.config.php) is not within the allowed path(s): (/var/www/vhosts/domain.com/httpdocs:/tmp) in /var/www/vhosts/domain.com/httpdocs/bookings/index.php on line 2

Warning: main(inc.config.php): failed to open stream: Operation not permitted in /var/www/vhosts/domain.com/httpdocs/bookings/index.php on line 2

Fatal error: main(): Failed opening required 'inc.config.php' (include_path='.:/var/www/vhosts/domain.com/private') in /var/www/vhosts/domain.com/httpdocs/bookings/index.php on line 2

I'm using a .htaccess file to assign the correct include_path using php_value flag, but I know that's not the problem, becuase I can get it to work if I'm including a file from a directory *within* httpdocs . . . any ideas how to solve this?

Many thanks!
 
hiye webguy. did you manage to get this sorted? I'm looking for a similar solution.

Dub
 
Back
Top