|
|||
|
Hi,
I hope this is in the correct area, but feel free to move the post if it has been wrongly posted! I'm new to the framework and I'm getting some problems with my bootstrapper I think it was. | |- public |-index.php |-.htaccess |-library |- Zend |-application |-model | - application |-controller |-model |-view Okay. I hope thats a bit clear but thats my current map structure. As you can see I don't have a controller or view defined yet. I was following a .flv movie that did it step by step and I can't really see whats wrong. The content of the .htacces file is very basic at the moment Code:
RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php Code:
<?php
// Error Reporting
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 'on');
//Modify include path to include path to library
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../library');
// ZEND Framework Includes
require_once "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');
//Get the front controller instance
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('../application/controller');
$front->throwExceptions(true);
// GO (run)
$front-> dispatch();
?>
Code:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with
message 'Invalid controller specified (index)' in
C:\xampp\htdocs\Testframework\library\Zend\Controller\Dispatcher\Standard.php:249 Stack trace: #0
C:\xampp\htdocs\Testframework\library\Zend\Controller\Front.php(914):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1
C:\xampp\htdocs\Testframework\public\index.php(24): Zend_Controller_Front->dispatch() #2 {main} thrown in
C:\xampp\htdocs\Testframework\library\Zend\Controller\Dispatcher\Standard.php on line 249
In the movie tutorial the say that the link works as follows http://localhost/public/controller/action so if i should type anything else behind that line. I should get the error message that the specified controller doesn't exist. The error I'm getting is a 404 error "Object not found". Does anybody know how I could solve this? A configuration error in apache? or something I forgot to include in my index.php? Hopefully somebody could help me solve this. Last edited by Filip : 04-01-2008 at 10:52 AM. Reason: typo |
|
|||
|
Okay, so I think I found out what to do.
I made a virtual host with something I found on the internet [code] <VirtualHost Localhost:80> DocumentRoot "PHYSICAL_PATH_TO_ROOT_FOLDER" ServerName COMPUTER_NAME RewriteEngine off <Location /> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !\.(pdf|php|js|ico|txt|gif|jpg|png|css|rss|zip|tar \.gz)$ /index.php </Location> </VirtualHost> [code] after I did this it rewrote the URL's correctly and gave the correct errors. I don't know if this might help somebody or if it's even clear at all Last edited by Filip : 04-01-2008 at 11:57 AM. Reason: added code tags |
![]() |
| Thread Tools | |
| Display Modes | |
|
|