View Single Post
Old 30.11.2007, 19:47   #1 (permalink)
gurdip
Junior Mamber
 
Join Date: Jun 2004
Posts: 45
gurdip is on a distinguished road
Default New module problem: fsockopen does not work within Joomla, ok outside of it.

Hi,

I posted this several days ago elsewhere but received no replies. Perhaps I should have posted it here?

I have a pagerank script that works perfectly on its own. It uses toolbarqueries.google.com to obtain the PR of an inputted url.

I converted the script to a Joomla module and successfully uploaded it (on the same server). However, it gives this error:

Code:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: 
getaddrinfo failed: Name or service not known in 
/home/powerarc/public_html/cms/modules/mod_pagerank.php on line 96

Warning: fsockopen() [function.fsockopen]: unable to connect to :80
 in /home/powerarc/public_html/cms/modules/mod_pagerank.php on line 96
Line 96 reads: $fp = fsockopen($googlehost, 80, $errno, $errstr, 30);

And $googlehost is defined earlier as:
$googlehost='toolbarqueries.google.com';

Substituting the host with its IP address made no difference.

I assume fsockopen is enabled on the server since the script works fine outside of Joomla. Any ideas why this error is occuring only inside Joomla? Is there some setting within Joomla causing this problem? How can I rectify it?

Thanks

gs
gurdip is offline   Reply With Quote
Sponsored Links