2008年8月19日星期二

Re: [fw-mvc] Only seeing file directory...

-- XebraTech <bobm@xebratech.com> wrote
(on Tuesday, 19 August 2008, 06:55 PM -0700):
>
> Yeah, this is really weird as this is a stock install of XAMPP:

<snip -- entire httpd.conf file>

> Here's the .htaccess
>
> ===== .htaccess ========================================
> RewriteEngine on
> RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
> ==========================================================

Okay, next step: permissions. Apache will not execute .htaccess files
unless certain conditions are met -- specifically, you need to tell
Apache that for the given directory, overrides are allowed. As an
example:

<Directory /my/awesome/zf-application/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Note the "AllowOverride" statement -- this is the one I'm referring to.
Make sure you have an entry like the above in your vhost definition or
in your httpd.conf file.


> Here's the index.php
>
> ===== index.php ========================================
> <?php
> require_once '../library/Zend/Controller/Front.php';
> Zend_Controller_Front::run('../application/controllers');
> ==========================================================
>
>
>
> Here's the IndexController.php
>
> ===== IndexController.php ========================================
> <?php
> /** Zend_Controller_Action */
> require_once '../../library/Zend/Controller/Action.php';
>
> class IndexController extends Zend_Controller_Action
> {
> public function indexAction()
> {
> }
> }
> ==========================================================
>
>
>
> Here's the index.phtml
>
> ===== index.phtml ========================================
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>My first Zend Framework App</title>
> </head>
> <body>
> <h1>Hello, World!</h1>
> </body>
> </html>
> ==========================================================
>
>
>
> Here's the directory structure I've setup: (from Zend Framework in
> Action/Manning Pub.)
>
> ===== DIRECTORY STRUCTURE ========================================
>
> /htdocs (this is webserver root directory as per http.conf)
> /HelloWorld (this is the demo app I'm trying to get working)
> /application
> /controllers
> IndexController.php
> /models
> /views
> /filters
> /helpers
> /scripts
> /index
> index.phtml
> /library
> /Zend
> /tests
> /web_root
> .htaccess
> /css
> /img
> index.php
> /js
>
> ==========================================================
>
>
>
> This has really got me stymied! :-(
>
> Seems that maybe I should change the Document root in the http.conf, but I
> don't want to kill all of my other development sites.
>
> Any help getting this working would be GREATLY appreciated.
>
> Thanks to any/all who can get me straightened out here.
>
> Best regards...Bob

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: