You are here: getimagesize():failed to open stream: « PHP Programming Language « IT news, forums, messages
getimagesize():failed to open stream:

Posted by sree on 12/17/46 11:53

Hi,

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.

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

if i run this file by giving
www.domainname.com/dev/imagesize.php?src=images/1.jpg

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

www.domainname.com/dev/imagesize.php?src=/images/1.jpg

or this

www.domainname.com/dev/imagesize.php?src=../images/1.jpg

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация