Zend Framework Deployment( on Ubuntu)

1, Install Zend Framework from terminal

"sudo apt-get install zend-framework"

 

2, create your project

" zf create project 'project-name' "

 

3, Create virtual host

"cd /etc/apache2/sites-enable"

"sudo vim 000-defalts"

add

              Alias /testzf/  "/path/to/quickstart/public"

  1.     SetEnv APPLICATION_ENV "development"
  2.  
  3.     <Directory /path/to/quickstart/public>
  4.         DirectoryIndex index.php
  5.         AllowOverride All
  6.         Order allow,deny
  7.         Allow from all
  8.     </Directory>
Then restart the apache server
"sudo /etc/init.d/apache2/ restart"
 
4, Notes: if you try your site "localhost/testzf/" now,
The 500 internal server error will raise.
 
go to check server error log locate at
"cd /var/log/apache2"
"vim error.log"
you can find the error

/home/peyton/Desktop/zf/testproject/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

then you need to load rewrite module

In Ubuntu you just need to input

"sudo a2enmod rewrite"

"sudo service apache2 restart"

then the problem is solved

5, open "localhost/testzf/" to see the default zend framework page.