This guide will explain how to set up the NetBeans IDE to work with the Zend Framework. It is worth noting that this guide has been written using NetBeans IDE 7.1 and the process may be different for older/newer versions
I make the assumption you have already downloaded and installed NetBeans and also have downloaded a copy of the Zend Framework.
Step 1 – Set up the include path
First you need to set up the include path within your php.ini file so that the zend framework is always included by default. If you have installed XAMPP via the windows installer as I have then you can skip this step as it sets up the include path to include the PEAR library (where we will place the Zend library) by default.
If you need to set the include path manually, open your php.ini file which in my case is located in C:xamppphp. Once open press control + f to search for Windows: “path1;path2. This will take you to the right location in the file. Below this line (which is commented out) add to the include path to your Zend library. For example: include_path = “.;C:xamppphpPEARZend
Step 2 – Windows Environment Variable PATH
It sounds complicated but it’s really simple. Right click on My Computer and click properties. Then follow this path… My Computer->properties->advanced->Environment variables. Once here select the variable called Path and click edit. Do not replace this variable but simply add the location of your PHP file to the end like so… ;C:wampphp. The ; acts as a seperator from the previous entry and the location path should be where your PHP file is installed locally. In my case, because I am using XAMPP it is ;C:xamppphpphp
Step 3 – Extract and place the Zend Library
Open the .rar file you have downloaded containing the Zend Framework, open it and navigate to library. In here is a folder called Zend. Extract this to you’re the PHP->PEAR library in your local installation. Again as I am using XAMPP the location for myself is C:xamppphpPEAR. Next go back to your downloaded .rar file and navigate to the bin folder. Extract the zf.bat,zf.php and zf.sh files to the PHP folder in your local installation (e.g. C:xamppphp).
Step 4 – Open NetBeans and tell it where Zend is
It is very important that if you have had NetBeans open during the set up of the first 3 steps that you CLOSE NETBEANS and REOPEN the IDE. Once NetBeans is running go to Tools->Options->PHP. In here select the PHP Interpreter (the php.exe file) which is located in the PHP folder of XAMP (C:xamppphp). Next, in the same options menu select the Zend tab and select the Zend Script which is the zf.bat file we extracted and placed earlier in C:xamppphp. Click Register Provider and click yes to any messages that appear.
Step 5 – Creating a Zend Project with NetBeans IDE
To set up a new Zend project in NetBeans click on File->New Project->PHP Application->(set your project location)->(set your project url)->Click Zend PHP Web Framework->Finish. Once you have completed this path, NetBeans will create a new Zend Project for you with the standard structure.
Step 6 – Managing a Zend Project within NetBeans IDE
Right click on the project in the sidebar of NetBeans and click Zend->Run Command. In here you will find all of the Zend Framework commands such as create controller, create module etc. You can now use these at any time within your project.
You have now installed and set up Zend within the NetBeans IDE and can use it as you desire. I hope you found this guide easy to follow. Please feel free to comment below and share if you wish. Thanks