How to setup Zend Framework and Zend Tool in Netbeans
I have assumed that you have installed Zend Server Community Edition (5.0.2) and Netbeans IDE (6.9.1)
1- You need to let netbeans know where zf.bat is
Tools-> Options -> PHP (Tab) -> Zend (Tab)
Locate zf.bat in Zend Script textbox, and click “Register Provider”.
2- You need to let netbeans know where php.exe is, this maybe optional but I think it’s a good practice
Tools-> Options -> PHP (Tab) -> General (Tab)
Locate php.exe in the PHP 5 Interpreter
I would also check “Web Browser”
These two steps should make everything ready to go for ZF developing, you can verify this by creating a new project, you should see Zend Framework when you are doing that. So go ahead and make a new Zend project.
You should also see a Zend item added to the context menu when you right click on your project’s name, there you must see all available zf.bat’s commands.
3- You should add Zend Framework’s Libraries to your “PHP include paths”.
Right click on your project,
Properties -> PHP include path (Item) -> Add folder
Locate and add “…….\Library\Zend\” from the place you have installed your Zend libraries.
This will only help you with code completion, for example when you type “$myvar = new Zend_” , Netbeans will list all available classes that are available and start with “Zend_”, this makes things much easier, but obviously is not a necessity. Notice that when you type “Zend_” You are searching through the zillions of classes that Zend Framework offers, therefore this will take a long time (It took 22 Seconds on my laptop), so don’t be demotivated, although I think Netbean’s code completion is not so great.
4- You need at add a VirtualHost to your Apache’s configuration and let NetBeans know where your Project URL is
Adding a VirtualHost can be very sophisticated, here are a few guides:
For my purpose I only added the following lines to my Apache’s httpd.conf:
<VirtualHost *:80> ServerName quickstart.local DocumentRoot /path/to/quickstart/public SetEnv APPLICATION_ENV "development" <Directory /path/to/quickstart/public> DirectoryIndex index.php AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
This will make Apache understand where your files are, make sure you only find the “Public” folder of your Zend Project, you don’t want other files and folders to be accessible, Apache will host your project on 10589 in my example so when you browse to http://localhost:10589/ you will see a “Welcome to the Zend Framework!” Page which means you are good to go.