what can cause this error: PHP Warning: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in Code (markup): I am using the function in a cron script and it keeps on being returned. Any ideas?
can you explain a little more what that means? also I don't get it every time the cron job operates. Just every now and then.
Basically, your script will query your server's DNS server for the address of the site/page you are trying to access. If the DNS server is unavailable or has an error, you will get the error that you are experiencing. Situations like this can be extremely difficult troubleshoot because there are many factors that could be causing the problem. I would first off see if you can find any errors in your DNS setup. I'm assuming you're using BIND. Your nameserver setup will be located in resolve.conf, usually int he /etc directory. Second, I would program some logic into your script. Something like if fsocketopen fail, do a sleep(5) or sleep(10) and retry. It would be a good idea to program the script to try 3 - 5 times total. Are you using a control panel to manage your server?
I am using cPanel, so I don't know much about what you are saying, though I like the logic part and I think I'll incorporate it