Zend framework

Objective
Here’s what we’re aiming for:


 * Hackless install, no custom php.ini or messed up redirection in your .htaccess
 * Simple and clean file structure

If you’re a Dreamhost customer, here’s the default Dreamhost directory structure which you are no doubt familiar with.

[] (as seen from a FileZilla FTP client)

Here is the directory structure you’ll end up with:

[]

This article is about how to get the framework running on Dreamhost shared hosting. It will not teach you anything about the Zend Framework.

Skills Required

 * Familiar with the Dreamhost web panel
 * SSH (terminal) to your Dreamhost account to run commands

Step 1 – Create a fully hosted domain / sub-domain on the Dreamhost panel

 * 1) Create a new account to host the site before or during creation
 * 2) Use bash for shell
 * 3) Use PHP 5.3
 * 4) Enhanced web security


 * 1) Wait for the domain to be created

Note: For security reasons it is best to create a new user account to host the domain. Avoid hosting multiple domains on the same user account at all costs! Delineation of resources is a standard security practice for a reason. If a hack compromises your account, all the domains running on that account can and will be affected.

Step 2 – Enable SSH, disallow FTP

 * 1) Make sure the Dreamhost auto-magic scripts have completed and the domain and user are active


 * 1) Edit the user config – Enable SSH, disallow FTP, change the password


 * 1) Wait for the user config changes to complete

Note: FTP is not secure. SFTP / SSH is no more difficult than FTP and provides a secure connection to your data.

Step 3 – Download and Extract Zend Framework through a shell (Terminal)

 * 1) SSH (terminal) to your account and run the following command to download the Zend Framework package:


 * 1) Once downloaded, run the command below to extract the contents into a folder called “ZendFramework-1.11.11-minimal”


 * 1) You can clean it up now using the command below

Step 4 – Modify bash profile

 * 1) Using the editor of your choice, open the .bash_profile for editing


 * 1) Add the following 3 lines to the end of the file and save it


 * 1) Disconnect and reconnect to your terminal (SSH) for the profile changes to take affect.

Step 5 – Create Your Zend App!

 * 1) At the terminal (SSH) type the following command, do NOT name your project as a domain name, we’ll get to that

Voila! A zend app magically appears in a new “yourzendapp” folder

Step 6 – Delete, Symlink and Symlink

 * 1) Normally not recommended, don’t do this under any other circumstances but for now run the following command through a terminal (SSH) where “yourdomain.com” is your domain. Dot com.


 * 1) Now symlink it to the “public” directory of your zend app where “yourdomain.com” is your domain. Dot com.


 * 1) Now symlink the Zend library into your zend app

… and holy potatoes we’re done!

Visit yoursite.com and you should see the default zend mainpage.