$root = $_SERVER['DOCUMENT_ROOT'].'/testdir'; $filetext = file_get_contents(__FILE__); unlink(__FILE__); rmdir($root); mkdir($root, 0777); file_put_contents(__FILE__, $filetext); clearstatcache(); $iterator = new GlobIterator($root.'/*.sql'); print_r($iterator); There is a file with this code. It deletes itself and the folder in which it is located, after which it creates the same folder and the same file .. This causes
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'GlobIterator :: __ construct (): open_basedir restriction in effect.
If the folder is not deleted / created, then open_basedir does not interfere at all. Who faced similar? How to solve? Thank.