views:

244

answers:

2

Hello everyone, I have a problem with using Zend framework (for YouTube data API). I created very simple PHP script for uploading YT videos using this API and it works almost everywhere - I tried it on 3 different machines (both Linux and WinXP). But after intalling it to 4th machine, I got this error:

Error:  inet_pton() [function.inet-pton]: Unrecognized address www.google.com  
Error type/ Nr.:    Warning - 2  
File:   /Zend/Validate/Ip.php  
Line:   62  
Line 62 source:  } else if ((@inet_pton($value) === false) ||(inet_ntop(@inet_pton($value)) !== $valueString)) {

I'm pretty sure it must be some configuration defect, but what's wrong? (PHP script is exactly similar on all instances)

+1  A: 

Modify /library/Zend/Validate/Ip.php between line 62 and 65 like :

} else if ((@inet_pton(gethostbyname($value)) === false) 
|| (inet_ntop(@inet_pton(gethostbyname($value))) !== $valueString)) {
        $this->_error();
        return false;
    }

$value must be an Ip Address and not a host name.

Kevin Campion