open_basedir_error_log.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Test open_basedir configuration
  3. --INI--
  4. open_basedir=.
  5. error_log=
  6. --FILE--
  7. <?php
  8. require_once "open_basedir.inc";
  9. $initdir = getcwd();
  10. test_open_basedir_before("error_log");
  11. var_dump(ini_set("error_log", $initdir."/test/bad/bad.txt"));
  12. var_dump(ini_set("error_log", $initdir."/test/bad.txt"));
  13. var_dump(ini_set("error_log", $initdir."/bad.txt"));
  14. var_dump(ini_set("error_log", $initdir."/test/ok/ok.txt"));
  15. var_dump(ini_set("error_log", $initdir."/test/ok/ok.txt"));
  16. test_open_basedir_after("error_log");
  17. ?>
  18. --CLEAN--
  19. <?php
  20. require_once "open_basedir.inc";
  21. delete_directories();
  22. ?>
  23. --EXPECTF--
  24. *** Testing open_basedir configuration [error_log] ***
  25. bool(true)
  26. bool(true)
  27. bool(true)
  28. bool(true)
  29. bool(true)
  30. Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  31. bool(false)
  32. Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  33. bool(false)
  34. Warning: ini_set(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d
  35. bool(false)
  36. string(0) ""
  37. string(%d) "%s/test/ok/ok.txt"
  38. *** Finished testing open_basedir configuration [error_log] ***