473,804 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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($s rc);
echo $imageInfo[0]." ".$imageInf o[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.getima gesize]: 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 9251

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($s rc);
echo $imageInfo[0]." ".$imageInf o[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.getima gesize]: 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
2381
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 (include_path='/usr/local/lib:/usr/local/lib/php') in /home/file.php on line 2 When I refersh browser everything is ok. Mentioned file exist and has correct rights. This happens in random places without any reason and regularity Can you advice something?
1
10684
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 minimum. simpleupload.php <form enctype="multipart/form-data" action="upload.php" method="post"> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="200000"/>
1
4706
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 i get is only some part of the respective url (the one i tried to load). The following is my php code to open the file: $file=...
0
2496
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" value="pras_sandilya@rediffmail.com"></td> </tr>
5
3283
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 who need php4 support) The version strings are as follows: # uname -a Linux server2 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 athlon i386 GNU/Linux
6
62772
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 protected. Any suggestions would be helpful, thank you for your time.
2
2490
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 Mining\public_html\lib\inc\functions.lib.php Line 673 : trigger_error("Failed to open stream to $filename. Permission denied!", E_USER_ERROR); could you plz tell the solution for how to avoid that errors
5
9103
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 stream: HTTP request failed! HTTP/1.1 401 Access Denied in ...' My PHP script is very simple: <?php
5
6884
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 I've tried outputting the file name and it's correct. I've looked online for help and it seems that people had to use trim() on the variable name and I did that but it still doesnt work. I'm opening this file when another file is open already...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.