0

I try to execute:

var_dump(ini_set("open_basedir",ini_get("open_basedir")));

with PHP and get false.

Apache 2. PHP Version: 5.3.28, it should change it from script, how i read at php.net documentation.

Currently open_basedir is .:/data/www/vhosts/hostname:/tmp

I try to do it at local server with same OS, Apache and PHP and all ok. I try to set already setted value because i try to debug why i can't put any value there. Help, please !

Deepak Rai
  • 2,163
  • 3
  • 21
  • 36
odd90058
  • 5
  • 4
  • PHP 5.3 was end-of-lifed like 7 years ago and `open_basedir` didn't always behave the same. Upgrade to a reasonably modern version of PHP. – Alex Howansky Jan 24 '21 at 00:25

1 Answers1

1

Typically open_basedir is no value in php 5. (hence it may return false -- if you are setting it by getting the current value and use var_dump for display).

I suggest you to use the following to see what actual value is the open_basedir in your system:

<?php
phpinfo();
?>

To further test, please try this code:

  1. use ini_set to set the value;
  2. return it;
<?php
//var_dump(ini_set("open_basedir",ini_get("open_basedir")));

ini_set("open_basedir", ".\hello");
echo "The open_basedir value is :". ini_get('open_basedir');
?>
Ken Lee
  • 6,985
  • 3
  • 10
  • 29
  • no, i have it, just want configure for web app. already resolve - check all php ini variables and see privs=4 – odd90058 Jan 24 '21 at 01:48
  • You can only make the path(s) of open_basedir more specific. It's not possible to set it to directories on the same or any above level. – T3rm1 Jul 20 '22 at 16:40