|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-10-21 16:03 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 08:00:02 2026 UTC |
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.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