473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

getimagesize():failed to open stream:

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
http://www.domainname.com/dev/images...c=images/1.jpg

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

http://www.domainname.com/dev/images...=/images/1.jpg

or this

http://www.domainname.com/dev/images..../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

Jul 21 '06 #1
1 9114

sree wrote:
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
http://www.domainname.com/dev/images...c=images/1.jpg

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

http://www.domainname.com/dev/images...=/images/1.jpg

or this

http://www.domainname.com/dev/images..../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
Jul 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Barti | last post by:
After upgrading php from 4.2.3 to 4.3.4 I have problem with "failed to open stream" Warning: main(): Failed opening '...........inc.php' for inclusion...
1
by: sa | last post by:
Trying to upload a file using win xp/iis/php. I've given full access to all accounts trying to get this to work? Yet I'm still getting read errors. Simplified the script below to the bare...
1
by: kencana | last post by:
Hi all, I was wondering why I always get "failed to open stream: HTTP request failed!" error in either loading a normal or xml file. i don't understand why i can't get the whole result. the result...
0
by: prasenjit2007 | last post by:
I have a main form for inputing the (to/from/mesg/file) with the following code:- <html> <body> <table> <tr> <td>To:</td> <td><input type="text" name="to" size="50" ...
5
by: xieliwei | last post by:
I have a freshly installed openSuSe 10.2 with PHP4 from http://download.opensuse.org/repositories/home:/michal-m:/php4/openSUSE_10.2/ (openSuSe abandoned PHP4 since version 10, but I have customers...
6
by: Andy2500 | last post by:
Hi, I'd like to upload an image to a folder, then I have 3 diffrents examples but all of them give an error "failed to open stream: Permission denied", althrough the C:\Inetpub\wwwroot is not...
2
by: swethak | last post by:
Hi, when i run my code it gives error as fopen(lib/providers//provider.RVLogic.php): failed to open stream: Permission denied in F:\Facebook\furniture11\Data...
5
by: tyakimov | last post by:
Hi guys I got a problem On my IIS server I changed the password for the Internet Guest Account 'IUSR_Machine' and suddenly the PHP part of the intranet stopped working. - '... failed to open...
5
by: phpnewbie26 | last post by:
I've been having trouble trying to open a file. It outputs fopen(/projects/CCPROT/ts_classes) : failed to open stream: No such file or directory in /mnt/raid/www/intra/admin/ts2/test2.php on line 72...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.