Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I relax PHP's open_basedir restriction?
    primarykey
    data
    text
    <p><a href="http://www.php.net/features.safe-mode" rel="noreferrer">open_basedir</a> limits the files that can be opened by PHP within a directory-tree.</p> <p>I am storing several class libraries and configuration files outside of my web root directory. This way the web server does not make them publicly accessible. However when I try to include them from my application I get an open_basedir restriction error like this:</p> <blockquote> <p>Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/var/www/vhosts/domain.tld/zend/application) is not within the allowed path(s): (/var/www/vhosts/domain.tld/httpdocs:/tmp) in /var/www/vhosts/domain.tld/httpdocs/index.php on line 5</p> </blockquote> <p>My web root is here:</p> <pre><code>/var/www/vhosts/domain.tld/httpdocs </code></pre> <p>My libraries and configuration directory are here:</p> <pre><code>/var/www/vhosts/domain.tld/zend </code></pre> <p>What would be the best workaround to relax the open_basedir restriction so that the the directory tree under the domain folder becomes available to my application? I have a number of domains that I want to do this with, and I'm also obviously wary of creating security vulnerabilities.</p> <p>Note: I am using CentOS, Apache, Plesk, and I have root ssh access to the server. And though this doesn't apply to Zend Framework directly, I am using it in this instance. So here is the inclusion from Zend's bootstrap:</p> <pre><code>define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../zend/application/')); set_include_path(APPLICATION_PATH . '/../zend/library' . PATH_SEPARATOR . get_include_path()); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload