PHP fsockopen woes
On my server, PHP's fsockopen function doesn't seem to work.
<?
echo fsockopen("www.myelin.co.nz", 80);
echo fsockopen("sxore.com", 80);
?>
This code runs fine at the command line (/usr/bin/php fsocktest.php
) but if I browse to it, I get these errors (repeated for sxore.com):
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/fsocktest.php on line 3
Warning: fsockopen(): unable to connect to www.myelin.co.nz:80 in /var/www/fsocktest.php on line 3
Update: Fixed this by installing PHP5 and Apache2 but not enabling either - huh? apt-get -t testing install libapache2-mod-php5
did the trick. Weird. Library mismatch?