So it is time to check out Zend Framework seeing how powerful everyone says it is. Setup is a bit annoying in comparison to other “funner” frameworks so I am going to document my findings as I learn. Here’s a guide to getting ZF working on your *nix dev box.

Setting up your environment

Using a SSH client such as Putty – connect to your web server and create a directory in your users home named “bin”

$ cd ~
$ mkdir bin
$ cd bin

Next we need to download a stable copy of Zend Framework via subversion using the following command :

$ svn checkout http://framework.zend.com/svn/framework/standard/branches/release-1.10/

If svn (Subversion) is not installed you can download via wget using the following command :

$ wget http://framework.zend.com/releases/ZendFramework-1.10.3/ZendFramework-1.10.3-minimal.tar.gz

Next we need to untar (decompress) the framework :

$ tar -zxvf ZendFramework-1.10.3-minimal.tar.gz

Rename the decompressed folder :

$ mv ZendFramework-1.10.3-minimal Zend

** Note if you used subversion to acquire Zend Framework – you probably have downloaded the release directory – use the command above replacing the first argument with the release directory name.

Move the scripts from the Zend/bin directory into the ~/bin directory; make them executable; rename zf.sh to just zf (for simplicity) :

$ mv Zend/bin/* .
$ chmod +x zf.sh
$ mv zf.sh zf

The next step is to add the zf script to the users include path, this allows us to use the zf command without having to specify the absolute path. Copy and paste the next 6 lines into your shell :

cat << EOF >> ~/.bashrc
if [ -d ~/bin ] ; then
PATH=~/bin:"\${PATH}"
fi
export PATH
EOF

You must now log out and back in to activate this path. Once you are logged back in you can test the zf command by typing :

$ zf show version

If you see “Zend Framework Version: 1.10.3″ you are ready to start your first project.

Creating your first project

Change to your web server document root, assuming you are using a Debian based server you can find it usually in /var/www (RHEL generally defaults to /var/www/html) :

$ cd /var/www

Create a project using the following command :

$ zf create project <project_name>

Where <project_name> is the name of your project in lowercase alpha numeric form (no symbols, spaces, uppercase letters (hyphens and underscores are OK))

Link your Zend library to your projects library directory as such :

$ ln -s ~/bin/Zend /var/www/project_name/library

Where /var/www is your web server document root and project_name is the name of your project.

If all went well – point your browser to your web server hostname or IP / your project name / public ( http://example.com/project_name/public ).

That is all for now – we’ll get into the actually writing some code next time. Leave me some comments below!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

You may or may not have noticed some uptime / server response issues with geekhut – this is because we have moved!  Our friend Randy Powell at GSMCall has graciously donated several powerful VPS boxes for geekhut, rappiddev and enumplus (among others) and we could not be happier.  Since I was so pleased with this service Randy and I came to an agreement to host all of our clients on a similar VPS box complete with a User Panel I have been tirelessly working on for a few weeks now.

One of the biggest problems switching hosts is migrating email accounts, luckily we use Zimbra and it was extremely simple – this is how I did it :

imapsync –nosyncacls –subscribe –syncinternaldates –host1 old.server.tld –user1 user@domain.tld –password1 password –host2 new.server.tld –user2 user@domain.tld –password2 password

IMAP Sync is a wonderful application that can easily be installed on RHEL5 / CentOS using the DAG repository (just google “DAG”).  There are three or four Perl dependencies to get it working however once you have everything installed you are ready to import.

This is more or less a note for my own records – hopefully you will find it useful as well.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

I have been up all night working on this template for a local business and have been running into some major issues with IE6 (what else is new?).  I have used !important in the past but not as heavily as for this project, sure learned a lot.

For those who don’t know – creating stylesheets that render identically in both Internet Explorer and Good browsers is a saught after talent.  I could get into a whole mess about how yucky it is working with IE but instead you can Google it yourself, someone else has no doubt already written about this much better than I can.

A quick explanation of !important is as follows :

Firefox renders it, Internet Explorer doesn’t.  For Example :

margin-left:10px !important;

margin-left:5px;

Firefox will push whatever div over 10 pixels while Internet Explorer will get confused, skip the line and render the 5px margin.

It is important to put !important before any other “contradicting” statements as it could play mind games and mess you up something awful.

Take a look at the in-progress template and tell me what you think…

http://rxbalance.enumplus.org

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

I have been in Denver Colorado for the past week at a natural health conference (I was the IT insurance in case something broke).  It turned out quite well, though I never got to see the rockies – a crying shame!  Anyway all was not lost, I was able to hit up the duty free in Niagara Falls late Wednesday evening for some wicked deals!

I ended up walking away with a 40oz bottle of rum (with Mai Tai mixer) and a carton of delicious Marlboro Reds for $50 on the dot – I couldn’t be happier!  Anyway it is Friday night and time to get full use of my purchases.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace

Let’s say you just dumped an entire database and are looking to import it elsewhere, possibly on a new host.  As soon as you install mysql-server on the new box a new password is set for user debian-sys-maint.

# mysqldump –all-databases -u root -p  > dump.sql

Once you import this database on the new host there is a good chance you will not be able to restart mysql as the debian-sys-maint user account passwords will not match.

# mysql -u root -p < dump.sql

So the easiest way to fix this issue is to :

web:~# cat /etc/mysql/debian.cnf 

# Automatically generated for Debian scripts. DO NOT TOUCH!

[client]

host     = localhost

user     = debian-sys-maint

password = PASSWORD

socket   = /var/run/mysqld/mysqld.sock

[mysql_upgrade]

user     = debian-sys-maint

password = PASSWORD

socket   = /var/run/mysqld/mysqld.sock

basedir  = /usr

Open PHPMyAdmin and click Privileges, then click “Edit” on the debian-sys-maint user.  There you can update the password found in the file above (PASSWORD).
Sure hope this helped – I know how much time I have spent in the past looking for an easy solution.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • NewsVine
  • Reddit
  • StumbleUpon
  • YahooMyWeb
  • Google Bookmarks
  • Yahoo! Buzz
  • TwitThis
  • Live
  • LinkedIn
  • Pownce
  • MySpace