1--TEST-- 2Test session_save_path() function : variation 3--SKIPIF-- 4<?php include('skipif.inc'); 5if(substr(PHP_OS, 0, 3) == "WIN") 6 die("skip Not for Windows"); 7?> 8--INI-- 9session.save_handler=files 10session.save_path= 11session.name=PHPSESSID 12--FILE-- 13<?php 14 15ob_start(); 16echo "*** Testing session_save_path() : variation ***\n"; 17$directory = __DIR__; 18$sessions = ($directory."/sessions"); 19 20chdir($directory); 21ini_set('open_basedir', '.'); 22// Delete the existing directory 23if (file_exists($sessions) === TRUE) { 24 @rmdir($sessions); 25} 26 27var_dump(mkdir($sessions)); 28var_dump(chdir($sessions)); 29ini_set("session.save_path", $directory); 30var_dump(session_save_path()); 31var_dump(rmdir($sessions)); 32 33echo "Done"; 34ob_end_flush(); 35?> 36--CLEAN-- 37<?php 38$directory = __DIR__; 39$sessions = ($directory."/sessions"); 40var_dump(rmdir($sessions)); 41?> 42--EXPECTF-- 43*** Testing session_save_path() : variation *** 44bool(true) 45bool(true) 46 47Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d 48string(0) "" 49bool(true) 50Done 51