Home >Backend Development >PHP Tutorial >ubuntu-PHP执行mkdir这个方法毫无效果

ubuntu-PHP执行mkdir这个方法毫无效果

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-02 11:29:441016browse

ubuntuphpxampp

我是Ubuntu14.04,XAMPP打包安装的php。
这是那段代码:
function makeDir($dir) {

if(!is_readable($dir)){
self::makeDir( dirname($dir) );
if(!is_file($dir)) {
echo "--------------------";
if(mkdir($dir, 0777, true)) echo "made the fucking dir!";
else error_response("make dir failed!");
chmod($dir, 0777);
}
} else error_response("exist dir");
}
调用是这样的: self::makeDir("./uploads/")
最后发现,执行mkdir无论如何都是false,也就是说mkdir失败。求解救!本人刚触摸php。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn