# PHP + load file from URL = crash

**URL:** <https://forum.kirupa.com/t/php-load-file-from-url-crash/194375>\
**Category:** programming\
**Created:** [July 22, 2006, 6:31pm UTC](https://forum.kirupa.com/t/php-load-file-from-url-crash/194375 "2006-07-22T18:31:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logikal2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/logikal2/32/1143_2.png) [@logikal2](https://forum.kirupa.com/u/logikal2)\
**Post date:** [July 22, 2006, 6:31pm UTC](https://forum.kirupa.com/t/php-load-file-from-url-crash/194375/1 "2006-07-22T18:31:30Z")

</div>

I’m not aware if there is a bug with the file\_get\_contents function but this one _should_ be running flawlessly. Its intention is to go to the URL and store the text (which happens to be an XML file) to $contents. However, every time I run it, I get the windows error “PHP interpreter has encountered a problem and needs to close”.

```php
<?php
$contents = file_get_contents('http://xml.weather.yahoo.com/forecastrss?p=24083');
echo $contents;
?>

```

I’m using PHP 4 with _allow\_url\_fopen_ enabled. Anyone know how to get around this?

Thanks in advance,  
Matt
