ZF-7506: exception 'Zend_Exception' with message 'File "Zend/Validate/Hostname/Com.php" does not exist or class "Zend_Validate_Hostname_Com" was not found

Issue Type: Bug Created: 2009-08-06T06:36:44.000+0000 Last Updated: 2009-08-06T07:47:40.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Diogo Oliveira de Melo (dmelo) Assignee: Thomas Weidner (thomas) Tags: - Zend_Gdata

Related issues: - ZF-6172



I'm getting the following exception:

exception 'Zend_Exception' with message 'File "Zend/Validate/Hostname/Com.php" does not exist or class "Zend_Validate_Hostname_Com" was not found in the file' in /opt/www/sites/ Stack trace:

0 /opt/www/sites/ Zend_Loader::loadClass('Zend_Validate_H...')

1 /opt/www/sites/ Zend_Validate_Hostname->isValid('<>')

2 /opt/www/sites/ Zend_Uri_Http->validateHost()

3 /opt/www/sites/ Zend_Uri_Http->valid()

4 /opt/www/sites/ Zend_Uri_Http->__construct('http', '//<>...')

5 /opt/www/sites/ Zend_Uri::factory('')

6 /opt/www/sites/ Zend_Http_Client->setUri('')

7 /opt/www/sites/ Zend_Gdata_App->performHttpRequest('GET', '', Array, NULL, NULL, NULL)

8 /opt/www/sites/ Zend_Gdata->performHttpRequest('GET', '')

9 /opt/www/sites/ Zend_Gdata_App->get('')

10 /opt/www/sites/ Zend_Gdata_App->importUrl('', 'Zend_Gdata_Feed')

11 /opt/www/sites/ Zend_Gdata_App->getFeed('', 'Zend_Gdata_Feed')

12 /opt/www/sites/ Zend_Gdata->getFeed(Object(Zend_Gdata_Query))

13 /opt/www/sites/ ImportController->gmailAction()

14 /opt/www/sites/ Zend_Controller_Action->dispatch('gmailAction')

15 /opt/www/sites/ Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))

16 /opt/www/sites/ Zend_Controller_Front->dispatch()

17 {main}

The problem is that it does not make any sense. I'm using Zend_Gdata and seems that Zend_Gdata is causing the bug.

Does anybody know how can I avoid this exception?


Posted by Ryan Boyd (rboyd) on 2009-08-06T06:57:43.000+0000

Do you have any custom error handling turned on?

Sometimes other frameworks configure custom error handling.. QCodo had that issue before for someone on the zf-gdata list. Here was my response back then:… " Hi Nico,

Okay, I've looked into this a bit further.

It looks like something in your code is overriding the error handling, so even though Zend/Loader.php:160 is intentionally suppressing any errors that occur, the code is ignoring that suppression.

What's happening here: The Zend_Validate_Hostname code is capable of having per-top-level-domain validation. It looks like this is primarily intended for international domain names, so there is no separate logic for '.com' extensions. The Zend_Validate_Hostname code is checking to see whether a file with the name Zend/Validate/Hostname/Com.php is readable by calling Zend_Loader::isReadable($filename), which is in turn checking whether fopen succeeds. For a vanilla PHP script/install, this will return false and move forward with execution because the '@' suppresses any errors from occurring. However, something in your script is actually overriding the error handling and causing that error to be thrown -- even though the suppression operator was used.

This PHP manual page has more information on error suppression:

Cheers, -Ryan "

Posted by Thomas Weidner (thomas) on 2009-08-06T07:42:11.000+0000

Note that this error of Zend_Validate_Hostname has been solved several months ago by me. We are at ZF 1.9.0 !!

Posted by Thomas Weidner (thomas) on 2009-08-06T07:47:40.000+0000

Issue fixed since 1.8.0.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.