#!/kubi/local/php/bin/php -q
<?php
function Directorys($dir){
return is_dir ( $dir ) or (Directorys(dirname( $dir )) and mkdir ( $dir , 0777));
}
$urls = './kubi/local/apache2/htdocs/kubi/Upload/'.date('Y').'/'.date('m').'/'.date('d').'/'.$lujing;
Directorys($urls);
绝对路径 相对路径我都用了都不能创建 如果用浏览器执行这个文件是可以创建的 用linux计划任务就是不可以
迷茫2017-04-10 14:44:17
你的代码里, 递归创建 nested directory的过程 确实很有趣.
但为什么不直接mkdir ( $dir , 0777, true)?
http://sg2.php.net/mkdir
recursive
Allows the creation of nested directories specified in the pathname.
试一下是不是这个引起的问题.