|The instructions provided in this article or section are considered advanced.|
You are expected to be knowledgeable in the UNIX shell.
- 1 Objective
- 2 Required Skills
- 3 The Process
- 3.1 Step one — Creating a fully hosted domain/sub-domain on the DreamHost panel
- 3.2 Step two — Enabling SSH and disallowing FTP
- 3.3 Step three — Downloading and extracting Zend Framework through a shell (terminal)
- 3.4 Step four — Modifying the bash profile
- 3.5 Step five — Creating your Zend app!
- 3.6 Step six — Deleting with Symlink
- 4 References
Here are the objectives:
- 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 with which you should be familiar:
Here's the directory structure you’ll end up with:
- [ http://www.bookerthedog.com/wp-content/uploads/2012/02/dhzend_images_002.jpg another screenshot from bookerthedog.com]
This article is about how to get the framework running on DreamHost shared hosting. It will not teach you anything about the Zend Framework.
You need to be:
- familiar with the DreamHost web panel, and
- able to SSH (terminal) to your DreamHost account to run a command.
Step one — Creating a fully hosted domain/sub-domain on the DreamHost panel
- Create a new account to host the site before or during creation.
- Use bash for shell.
- Use PHP 5.4 for enhanced web security.
- Wait for the domain to be created.
Step two — Enabling SSH and disallowing FTP
- Make sure the DreamHost auto-magic scripts have completed and the domain and user are active.
- Edit the user config: enable SSH, disallow FTP, and change the password.
- Wait for the user config changes to complete.
Step three — Downloading and extracting Zend Framework through a shell (terminal)
- SSH (terminal) to your account and run the following command to download the Zend Framework package:
- Once downloaded, run the following command to extract the contents into a folder called “ZendFramework-1.11.11-minimal”:
tar -xvf ZendFramework-1.11.11-minimal.tar.gz
- To clean it up, use the following command:
Step four — Modifying the bash profile
- Using the editor of your choice, open the .bash_profile to edit.
- Add the following three lines to the end of the file and save it:
PATH=$PATH:$HOME/ZendFramework-1.11.11-minimal export PATH alias zf=$HOME/ZendFramework-1.11.11-minimal/bin/zf.sh
- Disconnect and reconnect to your terminal (SSH) for the profile changes to take affect.
Step five — Creating your Zend app!
- At the terminal (SSH), type the following command (do NOT name your project as a domain name yet):
zf create project yourzendapp
- Voila! A zend app magically appears in a new “yourzendapp” folder!
- Run the following command through a terminal (SSH) where “yourdomain.com” is your domain.com:
rm –rf yourdomain.com
- Symlink it to the “public” directory of your zend app where “yourdomain.com” is your domain.com:
ln -s yourzendapp/public yourdomain.com
- Symlink the Zend library into your zend app:
cd yourzendapp/library ln -s ../../ZendFramework-1.11.11-minimal/library/Zend
- And that's it... you finished it!
Visit yoursite.com and you should see the default zend mainpage.