I am a php beginner, so apologize if this question is silly.
I am encountering apparently random script stops when I try to
get a remote HTML file with either file() or fopen(). A
typical code snippet:
echo 'here we go...';
$handle=fopen($ url,'r');
echo 'and here we are';
if ($handle==FALSE )
{
do some stuff
}
I can try to use that to obtain several hundred similar files,
and have it go through a dozen or a hundred of them getting,
every time,
here we go...and here we are
and, more important, the file read just fine. But, sooner
or later in such a run, I will get the first echoed message but
not the second (that is, "here we go..." and nothing else) and
the script will have stopped dead. I have this in the script:
function bye()
{
echo 'SHUT DOWN!'.$p;
}
register_shutdo wn_function('by e');
I never see that message when it stops (though i do if the
script hits an exit statement). I also have this:
set_time_limit( 0);
The php version is 4.2.2 on a server running BSD.
I encounter exactly the same behavior trying to fetch files
using
$remotefile=fil e($url);
On random occasions it just never comes out of the function.
This is driving me mad. Can anyone tell me what I am doing
wrong?
--
Cordially,
Eric Walker
Owlcroft House
I am encountering apparently random script stops when I try to
get a remote HTML file with either file() or fopen(). A
typical code snippet:
echo 'here we go...';
$handle=fopen($ url,'r');
echo 'and here we are';
if ($handle==FALSE )
{
do some stuff
}
I can try to use that to obtain several hundred similar files,
and have it go through a dozen or a hundred of them getting,
every time,
here we go...and here we are
and, more important, the file read just fine. But, sooner
or later in such a run, I will get the first echoed message but
not the second (that is, "here we go..." and nothing else) and
the script will have stopped dead. I have this in the script:
function bye()
{
echo 'SHUT DOWN!'.$p;
}
register_shutdo wn_function('by e');
I never see that message when it stops (though i do if the
script hits an exit statement). I also have this:
set_time_limit( 0);
The php version is 4.2.2 on a server running BSD.
I encounter exactly the same behavior trying to fetch files
using
$remotefile=fil e($url);
On random occasions it just never comes out of the function.
This is driving me mad. Can anyone tell me what I am doing
wrong?
--
Cordially,
Eric Walker
Owlcroft House
Comment