realpath() open_basedir 限制生效. [英] realpath() open_basedir restriction in effect.
问题描述
我正在尝试让我的 Zend Framework 应用程序在我的 VPS 上启动并运行.我收到此错误:
I'm trying to get my Zend Framework application up and running on my VPS. I'm receiving this error:
错误
警告:realpath() [function.realpath]:open_basedir 限制生效.
Warning: realpath() [function.realpath]: open_basedir restriction in effect.
显然,这在 Plesk 的默认限制中很常见,所以我相信你们中的一些人遇到了同样的问题.
Apparently this is quite common with Plesk's default restrictions so I'm sure some of you have faced the same problem.
我的尝试
在/var/www/vhosts/DOMAIN/conf/中,我使用 Virtuozzo 电源面板创建了文件 vhost.conf.下面是我放在 vhost.conf 中的代码:
In /var/www/vhosts/DOMAIN/conf/ I have created the file vhost.conf using the Virtuozzo Power Panel. Below is the code that I placed in vhost.conf:
尝试 1
<Directory /var/www/vhosts/DOMAIN/public>
<IfModule sapi_apache2.c>
php_admin_value open_basedir none
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir none
</IfModule>
</Directory>
尝试 2
<Directory /var/www/vhosts/DOMAIN/public>
php_admin_value open_basedir none
</Directory>
我也重新启动了 httpd 服务.
I've also restarted the httpd service.
文件夹结构
我的文件夹结构如下:
/var/www/vhosts/DOMAIN/application
/var/www/vhosts/DOMAIN/library
/var/www/vhosts/DOMAIN/public
任何帮助将不胜感激.
推荐答案
我觉得你需要为整个项目设置open_basedir
:
I think that you need to set the open_basedir
for the entire project:
<Directory /var/www/vhosts/DOMAIN>
php_admin_value open_basedir none
</Directory>
您还需要将 DocumentRoot
设置为:
You will also need to set the DocumentRoot
to:
DocumentRoot "/var/www/vhosts/DOMAIN/public"
虽然.
这篇关于realpath() open_basedir 限制生效.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!