Installing Apache, MySQL, PHP, Zend Framework and Eclipse PDT on a Windows 7 Box

Here is the step by step instructions for installing Eclipse PDT, Zend Community Edition, Zend FrameWork and getting it all working.

To have a full install of Apache, PHP, MySQL, Eclipse PDT, XDebug and Zend Framework. The software will be installed to the standard place in a windows install (windows 7) and the data/development files will be stored on G:/
I will have separate hostnames for each project ie http://project1.localhost

Software required.
I used to use WAMP but it became a nightmare to manage. The Zend Server Community Edition seems to be much easier to work with and integrates nicely with all the other components.

Zend Server Community Edition (CE)
Eclipse PDT

Installing Eclipse (V1.2.1)
I downloaded the 140MB All in one file which is in zip format.
There is no installer so I simply unzipped it to the program Files directory on my C: drive. Lots of windows 7 admin prompts later and it is installed. I then created an icon on my taskbar.
When you first load it, it asks you for a default workspace location. I choose G:\Eclipse WorkspaceThen click on File menu -> New -> PHP Project
Enter the project name at the top and click finish

Now we need to install Zend Server and configure it.

Installing Zend Server CE (V5.2.11-4.0.6)
Click next etc until you get to the page where you select the type of install. Click on Custom.
I disabled the Oracle install and enabled MySQL and phpMyAdmin.
All the next steps I used the default setting for.
After it has all installed it will pop up a browser window which will ask you to set the password. After you have done this it will take you to the management screen.

Edit C:\Windows\System32\drivers\etc\hosts as administrator and add the following lines projectname.localhost

Edit C:\Program Files (x86)\Zend\Apache2\conf\httpd.conf
Add the following lines.

<Directory "G:\Eclipse WorkSpace">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

Then edit C:\Program Files (x86)\Zend\Apache2\conf\extra\httpd-vhosts.conf
Add the following lines.

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin nothing@nothing.localhost
    DocumentRoot "G:\Eclipse WorkSpace\Project Name\quickstart\public"
    ServerName projectname.localhost
    ErrorLog "logs/projectname-error.log"
    CustomLog "logs/projectname-access.log" common

Now go to a DOS command prompt and CD to the directory “G:\Eclipse WorkSpace\Project Name\” and enter this command
zf create project quickstart

This will now create a full directory tree populated with the required Zend Framework (ZF) files.

Restart apache and go to http://projectname.localhost

You can now see why the project folder and the folder that you set Documentroot to is different. A lot of the files that ZF needs are held below the root of the visible website but need to be accessible by Eclipse.

If you now go into Eclipse and hit the F5 key you will see the files created by ZF listed in the PHP Explorer.

Next:I will do an article on installing and testing the debugger and integrating Smarty 3.x.

1 Comment

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.