Jump to content

Archived

This topic is now archived and is closed to further replies.

ankur0101

addModuleDirectory is not working in Zend

Recommended Posts

Hi,

Here is a structure of my testing site :

 

under document root ->>>

 

tempmvc.jpg

 

Uploaded with ImageShack.us

 

When I go to localhost/zend , I get following error :

 

 

Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/application/modules,/application/modules) [<a href='directoryiterator.--construct'>directoryiterator.--construct</a>]: The system cannot find the path specified. (code: 3)' in D:\xampp\php\includes\Zend\Controller\Front.php:289 Stack trace: #0 D:\xampp\php\includes\Zend\Controller\Front.php(289): DirectoryIterator->__construct('/application/mo...') #1 D:\xampp\htdocs\zend\index.php(8): Zend_Controller_Front->addModuleDirectory('/application/mo...') #2 {main} Next exception 'Zend_Controller_Exception' with message 'Directory /application/modules not readable' in D:\xampp\php\includes\Zend\Controller\Front.php:292 Stack trace: #0 D:\xampp\htdocs\zend\index.php(8): Zend_Controller_Front->addModuleDirectory('/application/mo...') #1 {main} thrown in D:\xampp\php\includes\Zend\Controller\Front.php on line 292

 

What to do ?

 

Share this post


Link to post
Share on other sites

It looks like you are referring to the root of the drive with the initial slash. Try removing that slash and see how it goes. If that does not work, we need the actual code you are using where the addModuleDirectory code is.

 

The main thing is, the path has to be found and either needs to be relative to the directory, in the include path or needs to be absolute from the root of the drive.

Share this post


Link to post
Share on other sites

Hi,

Following is a code of D:/xampp/htdocs/zend/index.php

 

<?php

// Load Front controller class
require_once('Zend/Controller/Front.php');

$frontController = Zend_Controller_Front::getInstance();

$frontController->addModuleDirectory('/application/modules');

$frontController->throwException(true);

$frontController->dispatch();

?>

 

If I make it as application/modules i.e. removing slash /, it gives following error :

Fatal error:  Call to undefined method Zend_Controller_Front::throwException() in D:\xampp\htdocs\zend\index.php on line 10

 

Share this post


Link to post
Share on other sites

So your line after the modules function does not exist. Read the manual on the frontController to find out what that method should be.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.