Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP open_basedir - to return value?

I want to return the value of open_basedir in a php script.. how can I do it? If value is blank it should echo that is blank..

Thanks!

like image 537
Adrian M. Avatar asked May 01 '10 11:05

Adrian M.


1 Answers

open_basedir is a setting that's configured in php.ini

So, you can get its current value with ini_get :

echo ini_get('open_basedir');


For example, if open_basedir is defined this way in my php.ini file :

open_basedir = /data/www:/var/www:/home/squale/developpement/tests

Then, the following portion of code :

var_dump(ini_get('open_basedir'));

Gets me this output :

string '/data/www:/var/www:/home/squale/developpement/tests' (length=51)
like image 157
Pascal MARTIN Avatar answered Oct 16 '22 03:10

Pascal MARTIN