# Apache fatal error due scraping script

**URL:** <https://forum.kirupa.com/t/apache-fatal-error-due-scraping-script/258501>\
**Category:** programming\
**Created:** [April 24, 2008, 3:42pm UTC](https://forum.kirupa.com/t/apache-fatal-error-due-scraping-script/258501 "2008-04-24T15:42:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![X\_plorer](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@X\_plorer](https://forum.kirupa.com/u/X_plorer)\
**Post date:** [April 24, 2008, 3:42pm UTC](https://forum.kirupa.com/t/apache-fatal-error-due-scraping-script/258501/1 "2008-04-24T15:42:58Z")

</div>

I’m using Apache 2.0.55 with PHP 4.4.2 on Win XP SP2. I was concerned to learn something about scrape technologies and after searching on Google I found a few tutorials and suggestion how to do it. But … :{  
I made some virtual folder on localhost on my computer, prepare a php page and start to write script.  
I wrote script like this one:

```auto
<?php
$url = "http://www.nfl.com/teams/sandiegochargers/roster?team=SD";
$raw = file_get_contents($url);
$newlines = array("	","
","\r","\x20\x20","\0","\x0B");
$content = str_replace($newlines, "", html_entity_decode($raw));
$start = strpos($content,'<table cellpadding="2" class="standard_table"');
$end = strpos($content,'</table>',$start) + 8;
$table = substr($content,$start,$end-$start);
preg_match_all("|<tr(.*)</tr>|U",$table,$rows);

foreach ($rows[0] as $row){

    if ((strpos($row,'<th')===false)){
   
        preg_match_all("|<td(.*)</td>|U",$row,$cells);
       
        $number = strip_tags($cells[0][0]);
       
        $name = strip_tags($cells[0][1]);
       
        $position = strip_tags($cells[0][2]);
       
        echo "{$position} - {$name} - Number {$number} <br>
";
   
    }

}
?>

```

I saved it like scrapeit.php and execute in IE and later in FF, but got twice Fatal error about Apache and nothing happend in window of IE (FF) :{  
Why? I tried some other (and smaller) scripts but same thing when I used function **file\_get\_contents** ()! :d: Do you know guys why!?
