|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-11 16:09 UTC] kylnas at tiscali dot it
Description: ------------ PHP 4.3.11 file_exists() doesn't works for some file (created by gd libray), instead if i create manually a file in the SAME directory the function works. Reproduce code: --------------- $file = 'images/products/thumbnails/11940-77_jpg_thumb_80x68.jpg'; if (file_exists($file)) echo 'yes'; else echo 'no'; Expected result: ---------------- YES. The file does exist. Actual result: -------------- NO. If I create a file in the same directory (like "tmp.gif") and I use the same function i get a "Yes" result. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 23:00:02 2025 UTC |
This is the code: <?php $filename = '../images/products/thumbnails/101D0-86_jpg_thumb_75x75.jpg'; echo 'File does exist but it is not found: ' . $filename . '<br />'; echo 'If you copy the destination in a browser the file is visible<br />'; if (file_exists($filename)) echo 'YES<br />'; else echo 'NO<br /><br />'; $filename1 = '../images/products/thumbnails/tmp_gif'; echo 'File (in the same directory)) does exist and it is found: ' . $filename1 . '<br />'; if (file_exists('../images/products/thumbnails/tmp.gif')) echo 'YES<br />'; else echo 'NO<br />'; ?> This is the online link: http://81.174.30.88/tmp/tmp.phpSo they have totally different owners and groups. Ok, at least this is a useful info. Now please do the following: <? var_dump(file_exists("/var/www/vhosts/mydomain/httpdocs/images/products/thumbnails/101D0-86_jpg_thumb_75x75.jpg")); ?> (or whatever the absolute path should be). And tell me plz: safe_mode is On or Off? And what's your error_reporting level along with display_errors ?Turn display_errors On in the beginning of the code: ini_set("display_errors", 1); and see if there are any error messages. Also, please tell me the value of "safe_mode" in phpinfo().