Bug #73369 [Ana->Nab]: file_exists, is_file

From: Date: Fri, 21 Oct 2016 23:19:40 +0000
Subject: Bug #73369 [Ana->Nab]: file_exists, is_file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204963@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73369&edit=1 ID: 73369 Updated by: rasmus@php.net Reported by: gufophp at gmail dot com Summary: file_exists, is_file -Status: Analyzed +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: linux PHP Version: 5.6.27 -Block user comment: No +Block user comment: Yes Private report: N New Comment: So look at the system calls and figure out why it isn't finding the file. There is no PHP bug here. Previous Comments: ------------------------------------------------------------------------ [2016-10-21 22:55:32] gufophp at gmail dot com the line is identical for you i have tested $file = "ephp/out"; if(is_file($file)){ include ($file); } not include out is_file("namefile.php") found is_file("ephp/out") not works $file = "ephp/eph_".$comando.".eph"; if(is_file(dirname(__FILE__)."/".$file)){ require ($file); } // works ------------------------------------------------------------------------ [2016-10-21 20:37:52] rasmus@php.net That may be, but then you need to provide something we can go on. for example: strace -o out php -r 'echo is_file("/bin/sh");' Then in the out file, look for /bin/sh. On my Linux machine I see: stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=113112, ...}) = 0 write(1, "1", 1) = 1 The = 0 means the stat succeeded and then PHP writes 1 to the out. If this doesn't work on your system you have a filesystem-related problem of some kind. It is extremely unlikely that this is a PHP bug since all it does is do a stat() syscall under the covers. ------------------------------------------------------------------------ [2016-10-21 19:39:41] gufophp at gmail dot com The bug is real. I not have cut and paste. ------------------------------------------------------------------------ [2016-10-21 17:56:51] rasmus@php.net You need to provide way more information here. Plus your test script could never work. is_file(file) is missing a $ ------------------------------------------------------------------------ [2016-10-21 16:03:35] gufophp at gmail dot com Description: ------------ incorrect is_file, file_exists file is accessile Test script: --------------- echo $file = "ephp/eph_".$comando.".eph"; // use a relative path not absolute require ($file); this found and the file is inluded if(is_file(file)){ require ($file); }else{ // echo "il file esiste"; } Expected result: ---------------- include a file Actual result: -------------- il file esiste ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73369&edit=1

« previous php.bugs (#204963) next »