linux - PHP Warning: mkdir(): Not a directory when creating directory -


i'm trying recursively create directories, php warning:

code:

<?php mkdir('data/1/0', 0755, true); 

output:

php warning: mkdir(): not directory in /home/myscript.php on line 1 

this running on linux.

from manual book, can see:

bool mkdir( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] ) 

http://www.php.net/manual/en/function.mkdir.php

when try mkdir data/1/0, can mkdir 0/ under directory data/1. when data/1 happens file instead directory, php issue warning php warning: mkdir(): not directory

so, when come warning, can check prefix of pathname file, directory expected.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -