Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php文件_存在的路径没有意义_Php_Drupal_Caching_File - Fatal编程技术网

php文件_存在的路径没有意义

php文件_存在的路径没有意义,php,drupal,caching,file,Php,Drupal,Caching,File,在我的drupal模块代码中,我检查路径是否存在,但即使路径存在,条件也不是真的 // for debugging $con .= $path; $con .= "<br>"; $con .= strval( file_exists($path) ); $con .= "<br>"; $con .= strval( is_dir($path) ); $con .= "<br>"; // end debug if (file_exists( $path ))

在我的drupal模块代码中,我检查路径是否存在,但即使路径存在,条件也不是真的

// for debugging
$con .= $path;
$con .= "<br>";
$con .= strval( file_exists($path) );
$con .= "<br>";
$con .= strval( is_dir($path) );
$con .= "<br>";
// end debug

if (file_exists( $path )) {
    // do bla
}

重新安装模块和清除drupal缓存也没有帮助

问题得到解决-对父目录的权限不够,不确定它是如何产生的,我在所有目录上将它们设置为775,也许在重新安装时

两个脚本中的$path匹配吗?您在实际代码中使用的示例路径相同吗?@Pekka-反过来说,它给出了假阴性。是的,我现在重新阅读并理解了。路径相同吗?您是否以同一用户的身份运行此操作?是。但它很好,不再出现了。谢谢你的支持!
<?php
$path = '/mnt/dataC/ebook';
$con = '';
$con .= strval( file_exists($path) );
$con .= strval( is_dir($path) );
echo $con;
?>
/dev/sdf1 on /mnt/dataC type reiserfs (rw,noexec,nosuid,nodev)