Thursday, April 21, 2011

How to Setup Zend Framework on XAMPP and XAMPP installation

Web developer, designers, consultants, and freelancers often want and need to showcase their work from their own local laptops without relying on internet services.  During an impromptu client meeting or job interview, you can showcase your website work even if their is no Internet service available.
zend framework
zend framework
XAMPP and the Zend Framework are both free to download and use.  XAMPP comes with the apache web server, php, phpmyadmin, perl, filezilla, mercury mail, and mysql.   Zend Framework provides MVC code generators and it is fairly easy to setup with XAMPP.  This post will give you instructions on how I install Zend Framework to windows.
XAMPP
  • Download XAMPP for Windows.
  • Follow the Installation Instructions for your Windows version.
  • Extract to C:\xampp
  • All of your future website files will be saved at C:\xampp\htdocs.  If you save the file “test.php” in the htdocs directory, you can access it with your webbrowser at  “http://localhost/test.php”   even while you have no Internet connection available.
  • Add php to your windows system variables:  Right Click on ‘My Computer’ > Properties > Advanced Tab > Environment Variables.  Environment Variables box will open,  View SYSTEM VARIABLES, scroll the list to  ’ PATH ‘  > double click  ’ PATH ‘ .   Click for ScreenShot.  Add the following line to the end of the PATH   ;C:\xampp\php\php.exe
Zend Framework
  • Register to Download the Zend framework full package from http://framework.zend.com/
  • Extract the Zend Framework files to C:\xampp\php\ZendFramework.
  • Edit the php.ini file.  You will find it at  C:\xampp\php\php.ini.  Find the line that says  ’  include_path  ’  and edit the line:                       Windows: “\path1;\path2″
    include_path = “.;C:\xampp\php\ZendFramework\library”
  • In the C:\xampp\php\ ZendFramework\bin   folder you will see a batch file that is used to create the MVC ( model, view, controller ) project structure for you.
  • Create a project inside your C:\xampp\htdocs folder, because apache is setup to serve your files from that directory.
  • Open a shell and cd to C:\xampp\htdocs folder and type this:
    C:\xampp\htdocs>C:\xampp\php\ZendFramework\bin\zf.bat create project testproject
  • If your shell does not scream any error messages with instructions to you, you can refresh your view of your directory at C:\xampp\htdocs  and you will see that new directories have been setup at  C:\xampp\htdocs\testproject.   The new directories in your testproject folder will include   >application >library >public  >tests  and the file  .zfprojects.xml
  • Now Copy the Zend Folder from your ZendFramework folder ( C:\xampp\php\ZendFramework/library/Zend) into the library folder of your new test project ( C:\xampp\htdocs\testproject\library\Zend)
  • Fire up the apache server from the xampp console and point your browser to http://localhost/testproject .   You should see a shiny perty blue screen like this:
    Zend Framework installed by Monica Peters
    Zend Framework installed by Monica Peters
    Congrats!  Now you can show off your website designs, developments, and ideas from your own laptop without relying on an Internet connection.  Not to mention that many employers are impressed by those that an install, configure, and maintain the Zend Framework, Xampp, and sweet home-spun Object Oriented Programming.  If you don’t care about any of that and just want all this work done for you, so you can focus on designing pretty stuff, contact me and I will install XAMPP and the Zend Framework for you. I am also available to train you how to use the Zend Framework for developing Object Oriented Php.

No comments:

Post a Comment