I'm trying to recursively create directories, but I get this PHP warning:
Code:
<?php mkdir('data/1/0', 0755, true);
Output:
PHP Warning: mkdir(): Not a directory in /home/myScript.php on line 1
This is running on Linux.
I'm trying to recursively create directories, but I get this PHP warning:
Code:
<?php mkdir('data/1/0', 0755, true);
Output:
PHP Warning: mkdir(): Not a directory in /home/myScript.php on line 1
This is running on Linux.
from the manual book, we can see:
bool mkdir( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] )
http://www.php.net/manual/en/function.mkdir.php
When we try to mkdir
data/1/0
, actually we can mkdir
0/
under the directory data/1
. But when data/1
happens to be a file instead a directory, php
will issue a warning PHP Warning: mkdir(): Not a directory
So, when you come with this warning, you can check that the prefix of the pathname is a file, where a directory was expected.