|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14631 is_file : Same function, different behavior?
Submitted: 2001-12-20 14:38 UTC Modified: 2002-04-03 02:57 UTC
From: azibutotal at spray dot fr Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.0.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: azibutotal at spray dot fr
New email:
PHP Version: OS:


 [2001-12-20 14:38 UTC] azibutotal at spray dot fr
Hi gurus and Fellows.

I've been through the Bug Database but didn't find out a related bug.  

I use a function that is common to two different pages.
(see code Below). These two pages are located in the same directory on my

For a given reason , (which I would like to know), the function is not
working any longer (but it USED to) on one of this page.
Actually I can point out where (what) it is not working :
->  if (is_file("upload/".$ZeFiles->file_name)){  ...
In one PHP page it says OK it is a file (and yes it is, if I type the address directly in the address bar) on the other page, it
says the opposite!!

If I take this condition off this condition it displays : 

Warning: Unable to open upload/1_o_alum_off.gif  
where "1_o_alum_off.gif" is the name of the (existing) picture...

The consequence being, I just cannot used the GetImageSize() function to retrieve the picture dimensions...

Any idea anyone ?


olivier aKa Cypher.


function listFilesFromDB($Ze_mydir, $connexion)
{//extract FileName from DB , gets its size and generate the
//Javascript code for a fitted "Pop Up" window.
 $resultat = ExecRequete ("select * from Files where us_id=".$Ze_mydir,

   if (mysql_num_rows($resultat)) {

    while ($ZeFiles = LigneSuivante ($resultat))
   if (!eregi(".mp3",$ZeFiles->file_name)){
      if (is_file("upload/".$ZeFiles->file_name)){   //just in case...//that's where the problem lies...
    $imagehw = GetImageSize("upload/".$ZeFiles->file_name); //let's create
PopUp to the Picture Dimensions...
    $imagewidth = $imagehw[0]+60;        //let's add an extra margin...
    $imageheight = $imagehw[1]+75;
    $zePopUpScript = "\n<a href=\"javascript:'showPortFolio.php?idFile=".$ZeFiles->file_id."','','resizable=y
es, scrollbars=yes, width=".$imagewidth .",height=".$imageheight."');
   else {// it is a mp3  file : no need for PopUp...A link should do...
   $zePopUpScript = "link to Mp3 file ".$ZeFiles->file_name;

  echo "<center>\n<table width=360><tr><td colspan=3><h1>-------------Your

  echo "<center>\n<h1>No Files so far</h1>\n</center>";


// calling the function :


PS : Code for both page available upon Request.
PHPinfo :


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-21 04:45 UTC] azibutotal at spray dot fr
A "PHP GURU" friend of mine finally found out a solution : 
I think I should share it with you : 
instead of 
if (is_file("upload/".$ZeFiles->file_name)){...  

You have to give the absolute (server-related) path to the file [PATH_TRANSLATED]: 

if (is_file("/home/circusp/am17204/upload/.. and so on..

Still, that doesn't account for the bug, as it works on the other file. That is just a "workaround" then. 

Hope this helps

 [2002-04-03 02:57 UTC]
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit

You should know current directory... and how absolute/relative path works.
This is not a develper issue according to your last post.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 22 14:01:23 2021 UTC