Setting in PHP.INI limiting whether PHP can access files outside of the specified directory tree.
Questions tagged [open-basedir]
148 questions
0
votes
1 answer
require_once() is blocked by open_basedir - then how to make system safe?
I have a website with a lot of important data and care about security, and now I must run there some potentially unsafe code (Joomla). I want to "enclose" this whole directory tree by open_basedir, and at the same time I wan't to hide database…

Tomas Telensky
- 1
- 1
0
votes
1 answer
How to disable open_basedir and allow_url_fopen in PHP
I'm currently working on a PrestaShop website and noticed that one of my addon does not work when open_basedir and allow_url_fopen are enabled.
How to disable openbase_dir and allow_url_fopen in php.ini on my local server?

JohnDickinson
- 97
- 1
- 3
- 11
0
votes
1 answer
Routing *.zip file requests one level above, with open_basedir in effect
Is it possible to use .htaccess to route zip file requests to the level of public_html, if open_basedir is in effect?
The reason I'm asking is because I'm trying to force a download of any of the zip files which are on the same level as public_html…

FiddlingAway
- 1,598
- 3
- 14
- 30
0
votes
0 answers
PHP opend_basedir restriction issues
I need help getting PHP (v5.4.45) errors and permissions working properly after a server was migrated. Some of my sites need to access some files from another domain on the same server.
For example,…

michaelespinosa
- 505
- 2
- 5
- 15
0
votes
2 answers
PHP Chmod Problem Creating files
I've got the following situation:
public_html - 755
=> avatar - 777
=> poll - 755
Now when I use the following code, i'll get an error (Warning: file_put_contents(../test.php) [function.file-put-contents]: failed to open stream:…

Simon
- 5,464
- 6
- 49
- 85
0
votes
1 answer
file_put_contents(): open_basedir restriction in effect. File(/tmp/XXX) is not within the allowed path(s): (/XXX) Ubuntu16.04
The problem is that type of error when I put my Laravel application on a server and Install a PDF plugin...
file_put_contents(): open_basedir restriction in effect. File(/tmp/XXXX) is not within the allowed path(s): (/home/admin/XXX)
So the problem…

Ivan
- 514
- 5
- 21
0
votes
1 answer
PHP ini_set open_basedir has no effect
I've got this problem on my Ubuntu + PHP 7.0.18 + Apache2:
In my php.ini is set the open_basedir = /var/www:/tmp. It works fine.
But in one web app I need to use another dirs to work with.
I am trying to set it through ini_set:
ini_set(
…

Kukymbr
- 3
- 1
- 2
0
votes
1 answer
open_basedir restriction error in codeigniter
I can't figure out how to fix this:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.
File(./codeigniter/logs/log-2010-11-12.php) is not within the allowed path(s):
(/var/www/vhosts/example.com/httpdocs:/tmp) in…

Brian
- 953
- 4
- 15
- 35
0
votes
1 answer
open_basedir in linux plesk error
I am trying to load a script from another webspace in plesk. I enabled open_basedir in the webspace and in my script I insert
include "/var/www/vhosts/example.com/httpdocs/app/";
However this is not working and I receive the following errors in…

Dimitrios Markopoulos
- 373
- 1
- 8
- 22
0
votes
2 answers
open_basedir won't let me write file, but directory seems correct?
Short story:
I'm getting an open_basedir restriction in my php script - a simple "test writing a new file to disk" script. It SEEMS to me that I've got the open_basedir settings correct and the file is in the right location - but no luck, just the…

larsiusprime
- 935
- 6
- 14
0
votes
0 answers
L5 artisan open_basedir restriction
Just need some help on how to fix this open_basedir restriction
I've tried to run a command php artisan
This is the error msg:
is_file(): open_basedir restriction in effect.
File(/opt/php-7.0/bin/php) is not within the allowed…

cresjie
- 469
- 2
- 13
0
votes
1 answer
Allow include from directory but prevent fopen to the same location
Im trying to figure out if there is a way I can allow include files to a certain directory outside of the open_basedir by allowing the path in open_basedir, but at the same time, prevent fopen, file_get_contents, etc from opening files in those…

Rick Kukiela
- 1,135
- 1
- 15
- 34
0
votes
1 answer
Include file from another domain sam server - 'failed to open stream: Permission denied in /var/www/vhosts/......'
I have build a custom CMS which is stored on a domain and the files are included on other website behind different domains on the same VPS. This way I can update my CMS without having to change every site.
I'm running CentOS7.2 with Plesk 12.5.3
I…

dna75
- 25
- 7
0
votes
0 answers
curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set
I am using .php files to send OTP messages for my app. When I hosted these files on my local machine, everything worked fine. Now,
I have hosted these files on hostinger, when I call one of these files I get a response saying
curl_setopt():…

Poda
- 1
- 1
0
votes
2 answers
Anyway to create a php sandbox for a user to develop in?
A user on my site and I are going to be developing a new web app. Id like to create a folder that we can work in without the fear that he could read outside that folder potentially reading config files etc.
Is there a way to create a sandboxed area…

Adam
- 55
- 1
- 4