I setup my symfony project (version 1.4) on Centos Linux VPS following all the instructions. When I open this file htp://myserver/backend.php I get this error:
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/var/www/html/myproject/web/../config/ProjectConfiguration.class.php) is not within the allowed path(s): (.) in /var/www/html/myproject/web/backend.php on line 4
Warning: require_once(/var/www/html/myproject/web/../config/ProjectConfiguration.class.php) [function.require-once]: failed to open stream: Operation not permitted in /var/www/html/myproject/web/backend.php on line 4
Fatal error: require_once() [function.require]: Failed opening required '/var/www/html/myproject/web/../config/ProjectConfiguration.class.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/myproject/web/backend.php on line 4
Safe mode is disabled in php.ini and in httpd.conf
The file backend.php on line 4 has:
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
This:
echo dirname(__FILE__).'/../config/ProjectConfiguration.class.php';
returns
/var/www/html/myproject/web/../config/ProjectConfiguration.class.php
What is wrong in there ?
I cannot figure out why is not working.
I added in the httpd.conf these lines:
<Directory /var/www/html>
php_admin_value open_basedir none
</Directory>
I don't know if this issue happens only in centos but the safe_mode disabled is not enough. open_basedir should be set to NONE.
Related
I got this error i tried to change permission for all files and folders nothing happen i tried to use dirname(FILE) but nothing happen is there anyone can help me ???
Warning: require_once(): open_basedir restriction in effect. File(/home/zadmin/public_html/XXXXXXXX/loader.php) is not within the allowed path(s): (/home/zadmin/public_html/XXXXXXXXXXXX/htdocs:/var/zpanel/temp/) in /home/zadmin/public_html/XXXXXXXXXXXXXX/htdocs/loader.php on line 10
Warning: require_once(/home/zadmin/public_html/XXXXXXXXXX/loader.php): failed to open stream: Operation not permitted in /home/zadmin/public_html/XXXXXXXXXXXXXXXXXX/htdocs/loader.php on line 10
Fatal error: require_once(): Failed opening required '/home/zadmin/public_html/XXXXXXXXXXXXXX/loader.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/zadmin/public_html/XXXXXXXXXXXXXXXXXX/htdocs/loader.php on line 10
You can only access to files set in your open_basedir directive, which are /home/zadmin/public_html/XXXXXXXXXXXX/htdocs and /var/zpanel/temp/.
If you need to load files directly from /home/zadmin/public_html/XXXXXXXXXXXX, set your open_basedir directive accordingly or contact your hosting provider to set it for you.
I'm using XAMPP with PHP 5.6.23 in Windows. I'm encountering open_basedir problem. When I run phpunit in command line, I got this.
D:\xampp\htdocs>phpunit --version
Warning: Unknown: open_basedir restriction in effect. File(D:\.bin\phpunit\phpunit.phar) is not within the all
owed path(s): (d:/wt-nmp) in Unknown on line 0
This version of PHPUnit requires PHP 5.6; using the latest version of PHP is highly recommended.
When I run phpdoc in command line, I got this.
D:\xampp\php\pear\phpDocumentor\vendor\bin>phpdoc --version
Warning: include(): open_basedir restriction in effect. File(D:\xampp\php\pear\phpDocumentor\vendor\phpdocumen
tor\phpdocumentor\src\phpDocumentor\Bootstrap.php) is not within the allowed path(s): (d:/wt-nmp) in D:\xampp\
php\pear\phpDocumentor\vendor\phpdocumentor\phpdocumentor\bin\phpdoc on line 19
Warning: include(D:\xampp\php\pear\phpDocumentor\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Bootstra
p.php): failed to open stream: Operation not permitted in D:\xampp\php\pear\phpDocumentor\vendor\phpdocumentor
\phpdocumentor\bin\phpdoc on line 19
Warning: include(): Failed opening 'D:\xampp\php\pear\phpDocumentor\vendor\phpdocumentor\phpdocumentor\bin/../
src/phpDocumentor/Bootstrap.php' for inclusion (include_path='.;d:/wt-nmp/include') in D:\xampp\php\pear\phpDo
cumentor\vendor\phpdocumentor\phpdocumentor\bin\phpdoc on line 19
Fatal error: Class 'phpDocumentor\Bootstrap' not found in D:\xampp\php\pear\phpDocumentor\vendor\phpdocumentor
\phpdocumentor\bin\phpdoc on line 21
In php.ini, the setting is
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
; open_basedir =
I tried to set open_basedir to none, but it does not work.
; http://php.net/open-basedir
open_basedir = none
I want to install Joomla on my website but I get these errors , what to do please?
Deprecated: Assigning the return value of new by reference is deprecated in /home/u806493334/public_html/includes/joomla.php on line 844
Warning: require_once(): open_basedir restriction in effect. File(/home/minhdiep/public_html/v1/includes/version.php) is not within the allowed path(s): (/home/u806493334:/usr/lib/php:/tmp) in /home/u806493334/public_html/includes/joomla.php on line 71
Warning: require_once(/home/minhdiep/public_html/v1/includes/version.php): failed to open stream: Operation not permitted in /home/u806493334/public_html/includes/joomla.php on line 71
Fatal error: require_once(): Failed opening required '/home/minhdiep/public_html/v1/includes/version.php' (include_path='.:/usr/lib/php') in /home/u806493334/public_html/includes/joomla.php on line 71
It appears that you've got to make some changes to your PHP.ini file. Have a look at the docs at open_basedir.
I'm trying to running a site on my local machine.
I've started modifying the htaccess file, using XAMPP.
Here is the old setting
php_value include_path .:/home/sites/www.example.it/example.it/htdocs/conf/
and here the new one
php_value include_path .:/conf/
The error I receive
Warning: require_once(conf.inc.php): failed to open stream: No such file or directory in C:\XAMPP\htdocs\wapp\index.php on line 2
Fatal error: require_once(): Failed opening required 'conf.inc.php' (include_path='.:/conf/') in C:\XAMPP\htdocs\wapp\index.php on line 2
Line 2 of index.php
require_once("conf.inc.php");
How can I solve this problem?
Your include path needs to point to where your files are on your computer:
php_value include_path .:C:\webfiles\example.it\htdocs\conf
I am using Reseller Club Multi domain Windows shared hosting on Plesk 10.
Getting following errors, i feel it's a server config issue, can you please suggest some solution
Warning: require_once(D:\INETPUB\VHOSTS\fitnessorganiser.com\ladybirdwebhost.com/wp-load.php) [function.require-once]: failed to open stream: No such file or directory in D:\INETPUB\VHOSTS\fitnessorganiser.com\ladybirdwebhost.com\wp-blog-header.php on line 12
Fatal error: require_once() [function.require]: Failed opening required 'D:\INETPUB\VHOSTS\fitnessorganiser.com\ladybirdwebhost.com/wp-load.php' (include_path='.;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\pear;./includes;./pear') in D:\INETPUB\VHOSTS\fitnessorganiser.com\ladybirdwebhost.com\wp-blog-header.php on line 12
Even when i try to post/add pictures in wordpress i get similar errors
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(C:\Windows\Temp\php7DD1.tmp) is not within the allowed path(s): (D:\INETPUB\VHOSTS\fitnessorganiser.com\httpdocs) in D:\INETPUB\VHOSTS\fitnessorganiser.com\httpdocs\wp-includes\functions.php on line 2505
79
see this kb:
http://kb.parallels.com/en/432