Forum Moderators: coopster

Message Too Old, No Replies

PHP File Function stopped working

PHP File Function

         

dtmuk

10:14 am on Jun 22, 2006 (gmt 0)

10+ Year Member



I first got a dedicated server that I physically own about a year ago. I installed Fedora Core 4 with a LAMP set up on it before it being taken to the data centre. I have a number of scripts with functions that use file($URL); to get an XML/Rss feed etc.
After about a month the file function stopped working completely.

The servers hard disk then stopped working about a month later. So I replaced the hard disk and reinstalled Fedora - the same set up. The file function had started working again!

One month later (Now) - Guess what's stopped working, the file function! why? i'm guessing its something to do with the security built into fedora maybe.

eelixduppy

11:23 am on Jun 22, 2006 (gmt 0)



This is a very strange problem! Are you sure you aren't accidentally changing the value of allow_url_fopen [us3.php.net] in your php.ini file? Check to make sure it's set to 1.

Good luck!

Romeo

11:52 am on Jun 22, 2006 (gmt 0)

10+ Year Member



Before swapping disks I would take a closer look:
First, you may check the webserver's error log to look for any hints as to why some function may not work at thre application level.
Then you may look into your server's log /var/log/messages if you find system errors reported for your disk drive (/dev/hda or similar).
You may consider installing `smartctl` to take a detailed look at various health and error counters of the harddisk.

At the end, perhaps you will find it being only some strange software setting, as eelixduppy suggests.

Kind regards,
R.

dtmuk

4:58 pm on Jun 22, 2006 (gmt 0)

10+ Year Member



allow_url_fopen is set to "On" in php.ini so that seems ok...

I've not tried watching the logs yet. But i thought i would add a description of what's actually happening, if you go:

<?
$data=file("http://dtm.org.uk/test.txt");
$data=implode("",$data);
echo $data;

echo "<br />";

$data=file_get_contents("http://example.org.uk/test.txt");
echo $data;

?>

You get nothing on the server in question.

[edited by: coopster at 6:08 pm (utc) on June 22, 2006]
[edit reason] generalized domain [/edit]