Skip to content

How to setup Zend Framework and Zend Tool in Netbeans

September 14, 2010

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:

http://httpd.apache.org/docs/1.3/vhosts/examples.html

http://files-source.zend.com/help/Zend-Server-Community-Edition/configuring_zend_framework.htm

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.

About these ads

From → PHP

5 Comments
  1. I used to see a 500 internal error when an error occured, so I changed the application.ini values

    #
    phpSettings.display_startup_errors = 0
    #
    phpSettings.display_errors = 0

    to 1, and now it shows the error properly

  2. Also, zend’s quickstart suggest the following virtual host settings:

    ServerName quickstart.local
    DocumentRoot /path/to/quickstart/public
    SetEnv APPLICATION_ENV “development”

    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all

    You also add 127.0.0.1 quickstart.local to your host file

  3. Yasser permalink

    To install on WAMP
    simply download the libraries, put them somewhere safe:

    add the path to include_path

    include_path = “.;c:\php\includes;C:\Libraries\”

    You are good to go

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: