getimagesize():failed to open stream:

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

   am new bie to this group. I requesting help from you all.

   Am geeting warnig with getimagesize() function. I will explain my
query by first giving my code.

       $src = $_GET['src'];

       $imageInfo = getimagesize($src);
       echo $imageInfo[0]." ".$imageInfo[1];

It's working perfectly as i want when, the image is in the absolute
path. For example i am running this file under the /dev folder in root
directory. In dev i have one more folder called images which contain
some jpeg and gif files. Also one more folder called imgs in the root.
For easy understanding i picturized my directory stucture here.

     ----- images             ---    This contains jpeg and gif files
     ----- dev
           ----- images       --- This also contains jpeg and gif files
           ----- imagesize.php     --- this is the file contains our

if i run this file by giving

It outputs the correct width and height of the image, but for this

or  this

It wont result any thing, however it thows warning message like this

Warning: getimagesize(/images/1.jpg) [function.getimagesize]: failed to
open stream: No such file or directory in
/home/htdocs/dev/imagesize.php on line 4.

So, this is not working for relative paths.

I have tried it in the different server which is also have same
directory structure. In that it's working for both absolute and
relative paths.

I thing i need to change my server's configuration. but i dont know
which parameter needs to be changed.

anyone please help in this regard...

Thanks in advance

Re: getimagesize():failed to open stream:

sree wrote:
Quoted text here. Click to load it

Site Timeline