I am completely new to the Zend Framework.
I wrote a simple web service that returns mock XML data from the Zend Framework, with a module structure like this:
AppName application configs application.ini modules default ..... api controller CatalogController.php view library public .htaccess index.php tests
In localhost (windows 7) they work:
http: // localhost
http: // localhost / api / catalog
http: // localhost / default
on my working server (linux), I get the file "404 not found":
http://107.22.255.126/api/catalog
http://107.22.255.126/default
but it works
http://107.22.255.126
I host it on Amazon web services.
Here is my .htaccess
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]
Here is my application.ini
[production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "Application" //resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.modules[] = "default" resources.modules[] = "api" resources.layout.layoutPath = APPLICATION_PATH "/layouts" resources.layout.layout = master [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
Here is my Bootstrap.php
<?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initRoutes() { $front = Zend_Controller_Front::getInstance(); $router = $front->getRouter(); $restRoute = new Zend_Rest_Route($front, array(), array('api')); $router->addRoute('api', $restRoute); } } ?>
I'm out of ideas. I suspect this is due to the router in bootstraper, but cannot find any solution.
Vhandled
source share