Forum Moderators: coopster
It used to work fine for over 3 years but for the past two weeks I keep getting the following errors which show up randomly and if you refresh the site the script might work fine again.
Warning: main(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/httpd/vhosts/domain/httpdocs/index.php on line 76Warning: main(http://www.domain.com/articles/quotes/quotes.php): failed to open stream: Resource temporarily unavailable in /home/httpd/vhosts/domain/httpdocs/index.php on line 76
At first, the script was setup to open up a small text file and display the text which it contained. The person who hosts the site for me suggested that instead of opening the file I should try a php array. So I did that and I still get the error that I posted above. The error seems to be intermittant.
I have also been told that the /tmp/ directory has been cleared. But that didnt resolve the problem.
Does anyone know what this error means and how to fix it?
<?php include "articles/quotes/quotes.php";?>
quotes.php has an array of quotes. Prior to that I was using a text file and had the following code to display the quotes:
<?php
$font ="Verdana";
$fontsize ="2";
$textfile ="http://domain.com/articles/quotes/quotes.txt";
echo "<font face=\"$font\" size=\"$fontsize\">";
$quotes = file("$textfile");
$quote = rand(0, sizeof($quotes)-1);
echo $quotes[$quote];
echo "</font>";
?>
Same error occured with both methods. As stated earlier it doesnt always happen and when it does occur refresh usually fixes it.
Thanks
The include path is:
include_path='.:/usr/share/pear'
My friend who is hosting my site on the server has also experienced this error a few times on his site. I am pretty sure its some kind of a server error but everytime the host replies and says they cant find anything wrong.
Would rebooting the server help?