My php script is located in /var/www/html/users/dev. I need to create a folder in /var/www/images/ – something like /var/www/images/test/test/ and store here some images.
But when i trying is with mkdir($file_dir, 0777); where $file_dir is /var/www/images/test/test/ i receive an error:
Warning: mkdir(): No such file or directory in /var/www/html/users/dev/classes/sites.class.php…
Because
"/var/www/images/test"does not exists, so you can notmkdir("/var/www/images/test/test")You can specify the
"$recursive"toTRUE, and it will work, like this:mkdir($file_dir, 0777, TRUE);