Problem with calling inet_pton () within Zend

I have a problem using Zend framework (for YouTube Data API). I created a very simple PHP script to download YT video using this API and it works almost everywhere - I tried it on 3 different machines (both Linux and WinXP). But after he pounced on the 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 sure this must be some kind of configuration defect, but what happened? (PHP script is completely like all instances)

+1


a source to share


2 answers


Change / library / Zend / Validate / Ip.php between lines 62 and 65, for example:

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

      



$ value must be an Ip address, not a hostname.

+1


a source


This indicates a bug in Zend_Validate_Ip

, try reading:

http://framework.zend.com/issues/browse/ZF-5186



And this google search:

http://www.google.com/search?hl=en&client=safari&rls=en-us&q=zend+framework+inet_pton%28%29+unrecognized+address&btnG=Search&aq=f&oq=&aqi=

0


a source







All Articles