failed to open stream: Bad file descriptor

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ravi
Forum Newbie
Posts: 13
Joined: Tue Aug 31, 2004 12:30 am

failed to open stream: Bad file descriptor

Post by ravi »

Code: Select all

<html>
 <head> </head>
 <body>
 <?php
  
  $handle = fopen("http://www.rediff.com/rss/inrss.xml", "r");
 ?>
 </body>
</html>

Code: Select all

Warning: fopen(http://www.rediff.com/rss/inrss.xml): failed to open stream: Bad file descriptor in c:\ecko\web\test\simple.php on line 6
what is the solution to access the files which is there on other webservers.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Is there a firewall blocking the connection?
ravi
Forum Newbie
Posts: 13
Joined: Tue Aug 31, 2004 12:30 am

Post by ravi »

some ISA server is there.The system is conected to proxy server.
what I should do if firewall is there.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

What does

Code: Select all

<?php
error_reporting(E_ALL); ini_set('display_errors', true);
$sd = fsockopen('www.rediff.com', 80, $err, $errno);
echo "$sd = fsockopen('www.rediff.com', 80, $err, $errno);";
?>
print?
ravi wrote:what I should do if firewall is there.
Ask the admin of the firewall server.
ravi
Forum Newbie
Posts: 13
Joined: Tue Aug 31, 2004 12:30 am

Post by ravi »

Warning: fsockopen(): unable to connect to http://www.rediff.com:80 in c:\ecko\web\test\simple.php on line 6
I have asked administrator's,they said everything properly set(username and password).
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

What username and password? Not in your script.
ravi
Forum Newbie
Posts: 13
Joined: Tue Aug 31, 2004 12:30 am

Post by ravi »

MY LOGIN NAME AND PASSWORD WERE SET PROPERLY IN PROXY.

This question actually I should no ask ,but I am asking,feel free

1) Your system is conected to proxy server or not.
2) In your system this code is working

thank you.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

ravi wrote:
MY LOGIN NAME AND PASSWORD WERE SET PROPERLY IN PROXY.
:?:
Please ask the administrator if you/your script has to authenticate against the proxy server and if how.
ravi wrote:1) Your system is conected to proxy server or not.
2) In your system this code is working
proxy: yes, proxy-authentication: no
ravi
Forum Newbie
Posts: 13
Joined: Tue Aug 31, 2004 12:30 am

Post by ravi »

1) I asked the system adminstrator.He said that you have already authenticated with the proxy server with
the following username ="bravi" and password = "bravi123".
2)does I need to write a script to authenticate?
3)can you tell me how to write that script.what is the material available.
thanking you
ravikumar
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Who are quoting?
ravi wrote:
1) I asked the system adminstrator.He said that you have already authenticated with the proxy server with
the following username ="xxxxx" and password = "xxxxx".
I have been authenticated? No ;)

Sorry, can't help you. Don't even understand you.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

ravi wrote:
1) I asked the system adminstrator.He said that you have already authenticated with the proxy server with
the following username ="xxxxx" and password = "xxxxx".
2)does I need to write a script to authenticate?
3)can you tell me how to write that script.what is the material available.
thanking you
ravikumar
I hope those aren't actual credentials.
Post Reply