30.07.2012 Views

Reference Guide

Reference Guide

Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

double quotes ("DOCUMENT_ROOT")<br />

Zend Server Best Practices<br />

Replace the port number with a unique port number dedicated to this Virtual Host. The<br />

port number (10089) has to be the same value for "Listen" and "VirtualHost".<br />

4. Zend Framework's MVC implementation makes use of the Front Controller pattern. You<br />

must therefore rewrite all incoming requests (except those for static resources, which<br />

your application need not handle) to a single script that will initialize the FrontController<br />

and route the request. If you're using mod_rewrite for the Apache web server, create the<br />

file /public/.htaccess with the following contents:<br />

# public/.htaccess<br />

RewriteEngine On<br />

RewriteCond %{REQUEST_FILENAME} -s [OR]<br />

RewriteCond %{REQUEST_FILENAME} -l [OR]<br />

RewriteCond %{REQUEST_FILENAME} -d<br />

RewriteRule ^.*$ - [NC,L]<br />

RewriteRule ^.*$ /index.php [NC,L]<br />

Note:<br />

Some web servers may ignore .htaccess files unless otherwise configured. Make sure that your<br />

web server is configured to read the .htaccess file in your public directory.<br />

5. Restart your Web server from the command line (windows user can use the Apache<br />

Monitor tool).<br />

Your Zend Framework projects will now be accessible from a browser through: http://localhost:10089/ (the<br />

port number 10089 should be replaced with the unique port you dedicated to this virtual host).<br />

415

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!