Tuesday, February 9, 2010

OpneSource Integrated development environment(IDE) called NetBeans for PHP

For coding purpose, we use different type of integrated development environment (IDE). There are so many IDEs and sometimes its difficult to choose the best one to use. As I am a php developer, my focus shall be on the IDE for PHP code snippet. I already used Zend IDE (of course the trial version), Dreamweaver. But  from the last few days i start coding on a IDE called NetBeans V.6.8. NetBeans is based on JAVA platform and it needs JRE(Java Runtime Environment) to be installed on the PC. Among the IDEs I have used so far, this one is the best. I have heard from many PHP developer that they don't find any IDE with debugging facility for php code testing. Apart the Zend Debugger(again you need the licensed copy), NetBeans has a built in debugging facility with Xdebug.



The most important thing for NetBeans is, It is Open Source and also its totally free. They have different language packs(PHP, Javascript, Ruby, Groovy, Python and obviously Java) of  NetBeans. Again I am particularly discussing with NetBeans IDE for PHP. The Key features of NetBeans IDE 6.8 are:

1. basic editing, syntax highlighting, code completion, occurrence highlighting.

2. semantic analysis with highlighting of parameters and unused local variables.

3. PHP code debugging with Xdebug.

4. PHP Unit testing with PHPUnit and Selenium.

5. Code coverage.

6. Symphony Framework support.(since version 6.8).

7. PHP 5.3 namespace and closure support (since version 6.8).

To setup NetBeans IDE 6.8 for  PHP, following steps should be taken.

  • Download the NetBeans IDE 6.8 for PHP pack from http://netbeans.org
  • Download the Java Runtime Environment (JRE) from http://java.sun.com
  • Follow the installation rules.
After you installing the IDE, you may want to setup the debugging option using Xdebug. I assume you have:

- Latest version of XAMPP/WAMP.
- Apache 2.2.11
- PHP 5.2.9-1

Follow the steps to configure Xdebug:

- Download the file http://www.xdebug.org/files/php_xdebug-2.0.4-5.2.8.dll.
- open your php.ini that is easily accesible from tray. Wamp tray icon -> PHP -> php.ini
- add following lines to your php.ini (anywhere you want) -

zend_extension_ts="C:/wamp/bin/php/php5.2.9-1/ext/php_xdebug-2.0.4-5.2.8.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

- Restart your local server(Apache) and run phpinfo().
- If all goes well, you'll see xdebug service is installed properly.


If you want to know more about how NetBeans work or PHPUnit test or Debugging using Xdebug, you can go to: http://netbeans.org and keep exploring.

I hope this article will help you to get the basic about NetBeans. You can leave a comment if you have any query. Happy Coding...........:)

      






No comments: