php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47911 file_exists slow performance
Submitted: 2009-04-07 00:38 UTC Modified: 2009-04-15 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: webmaster at 303030 dot com Assigned:
Status: No Feedback Package: Performance problem
PHP Version: 5.2.9 OS: winxp
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at 303030 dot com
New email:
PHP Version: OS:

 

 [2009-04-07 00:38 UTC] webmaster at 303030 dot com
Description:
------------
i have one script which use file_exists 
am upfrading from php4 
after upgrade my page take 7 or 10 seconds to exectuted 
i test the same script under php4 it take less than 1 second
i remove file_exists from the script the page executed less than 1 second 
so i bleve that the problem is in file_exists 

Reproduce code:
---------------
<?
$mokhatatpicp="../mokhatatpic/".$row[mokhatatid].".pdf";
$mokhatatpicj="../mokhatatpic/".$row[mokhatatid].".jpg";


 
if(file_exists($mokhatatpicp))
{
$mokhatatpicp="mokhatatpic/".$row[mokhatatid].".pdf";
echo"<a href=#   onclick=\"showModalDialog('../picview.hnt?myx=$mokhatatpicp&hex=embed%20'  ,'?????','width:1200;resizable: yes; help: no; status:no; scroll: no;');return false;\"  ><img src=../images/image.jpg border=0></a>";
}
elseif(file_exists($mokhatatpicj))
{
$mokhatatpicj="mokhatatpic/".$row[mokhatatid].".jpg";
echo"<a href=#   onclick=\"showModalDialog('../picview.hnt?myx=$mokhatatpicj'  ,'?????','full-screen:yes;resizable: yes; help: no; status:no; scroll: no;');return false;\"  ><img src=../images/image.jpg border=0></a>";
}
else
{echo "<img src=../images/delete.gif border=0>";}
 
?>

Expected result:
----------------
this only snippt of the code so i didnot expect any result 

Actual result:
--------------
this only snippt of the code so i didnot expect any result 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-07 09:07 UTC] jani@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2009-04-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 06:03:45 2022 UTC