php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8971 fopen("http://my.url.com","r") hangs my script
Submitted: 2001-01-28 19:36 UTC Modified: 2001-05-30 11:51 UTC
From: andreas at brosten dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: Redhat Linux 7.0 (fully updated)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andreas at brosten dot com
New email:
PHP Version: OS:

 

 [2001-01-28 19:36 UTC] andreas at brosten dot com
The problem is that when I open a web-page with the fopen("url","r") function, my scirpt hangs for no preticiular reason. It occurs both if I run 'php myscript.php' and if I use it on a web-page.

A script that reproduses the problem could be found at
http://h45.ryd.student.liu.se/php/tips/ratta.phps

I Run the PHP RPM package that's supplied by RedHat. It's fully updated to the latest version.
I havn't changed anything in my php.ini, so I guess it looks in the way RedHat has made it. I can send it to anyone who'd like to see it.

I run apache 1.3.14-3 (RPM installed).
The machine is a P166 with 96MB of ram. As I said, it runs RedHat 7.0 with all updates. the 2.2.16-22 kernel is used. 

If you'd like to know something else about the env. just let me know!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-30 11:51 UTC] sniper@php.net
Should be fixed in PHP 4.0.5.
And if I were you I would update to RH 7.1 too.

--Jani

 [2011-05-22 14:24 UTC] ruman011 at gmail dot com
I am not sure if it will work on linux operating. But you can try this. . .

<?php

  function open_url($url) {
	
	$url = fopen($url,'r');
  	
	while (!feof($url)) {

	$line_of_text = fgets($url);
	
	echo $line_of_text . "<br>";
  }

  fclose($url);

  }

$link = "http://wap.prince33.tk/pm";

open_url($link);


?>
 [2011-05-22 14:26 UTC] ruman011 at gmail dot com
I am not sure if it will work on linux operating. But you can try this. . .

<?php

  function open_url($url) {
	
	$url = fopen($url,'r');
  	
	while (!feof($url)) {

	$line_of_text = fgets($url);
	
	echo $line_of_text . "<br>";
  }

  fclose($url);

  }

$link = "http://yourlink";

open_url($link);


?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC