Search This Blog

Friday, February 18, 2011

How to install Zend framework with XAMPP

I, like most web developers, use the excellent XAMPP to develop and test PHP/MySQL websites and applications on my local machine. The problem is the XAMPP doesn’t come with the Zend framework installed by default.

If you want to develop with Zend, you could always use Zend Server CE instead of XAMPP, as Zend Server comes with the Zend framework installed. The downside to that is that the Zend server is not as simple to set up and use as XAMPP, and if you’ve already been using XAMPP, migrating to Zend server can be a real pain in the ass, and you can’t run both XAMPP and Zend server together.

If you google installing Zend in XAMPP, there are many different guides, all of which seem overly complicated. Installing the zend framework under XAMPP is actually a lot simpler than most guides online would suggest, and using the following guide you should be able to run Zend Apps in your existing XAMPP environment in a matter of minutes.

Step 1 – Locate your PHP include path.

This is the location the Zend framework needs to be installed to. You can easily find your include path by going tohttp://localhost/ (with XAMPP running) and clicking the phpinfo() link on the left menu. Near the top of that page, under the core heading will be row called “include_path”, the value in the column next to it is the one you want, eg: “C:\xampp\php” in windows or ”/opt/lampp/lib/php” in linux.

Step 2 – Download and extract the Zend framework.

You can download the Zend framework for free here: http://framework.zend.com/download/latest, I’d recommend downloading the full package, as keeping things light weight isn’t imperative on a test/development environment, and that way you’ll be less likely to need to add anything in the future. Once the Zend framework has downloaded, extract it, and you should get a folder called somthing like “ZendFramework-1.10.4″, obviously the version numbers may be different.

Step 3 – Install Zend to your PHP include path.

Now all you have to do in copy the relevent Zend files to your PHP include path. To find the files you need to copy, open up you extracted Zend framework download, find the ‘library’ folder and open that. In that folder there is a folder called ‘Zend’, you’ll need to copy that entire folder to your PHP include path.

If you’re using windows that should be a simple drag and drop into your PHP include path. If you’re using linux, you’ll need to copy using sudo, eg: “sudo cp -r Zend/ /opt/lampp/lib/php”.

If it all went to plan you will now have a folder called ‘Zend’ in your PHP include folder and your Zend framework is ready to go. Told you it was easy.


No comments:

Post a Comment