I installed the latest Netbeans and did not find any PHP project templates to create a PHP project.

When I checked the New project options, It contains all standard web and maven application options.

This tutorial explains how to add PHP support and create a PHP project in Netbeans. It is easy to add PHP support via PHP Plugins.

Adding PHP support to Netbeans, the Developer has required tools such as an Editor, debugger, and documentation for PHP application development. First, Download and Setup Netbeans

Once Netbeans is running, add the php plugin to Netbeans.

How to add PHP Support in Netbeans

To add Php Support to Netbeans, Please follow the below steps.

  • Open Netbeans IDE
  • In Netbeans Editor, Select the Tools menu -> Plugins Option
  • It opens the Plugins Window Dialog
  • Select the Settings Tab
  • Select Configuration of Update Centers dropdown with the value Netbeans Distribution option checked if already not checked.
  • Next, Go to the Available Plugins Tab
  • You will see a lot of plugins for PHP frameworks such as PHP, Zend Framework, CakePHP Framework, etc.
  • Checked the PHP option plugin, It provides tools for PHP editor, debugger, etc.
  • Click on the Install option, Follow instructions, it installs PHP and its dependencies ApiGen and PHP Static Analysis.
  • Restart IDE to complete installation.
  • Now, able to create PHP Projects.

PHP plugin is added to Netbeans, The Next setup is to update or change the PHP interpreter

  • In Netbeans IDE, Select the Tools menu -> Options Option
  • Select PHP options, open PHP tab
  • Change the path of the PHP interpreter executable
  • Update it if any settings are required.

How to create a PHP project in Netbeans

Once the PHP plugin is added to Netbeans, you will be able to see PHP application options in Netbeans.

To create a PHP project, please follow the below steps.

  • Select File Menu + Select New Project ( or use the shortcut command Ctrl + Shift + N)
  • It Opens the New Project window dialog, Select the following
  • Select PHP in Categories on the left side, Right side, Select PHP Application.
  • Next, Enter the following
    • Project Name: firstphpproject
    • sources Folder: newly created project location to save
    • Optionally, You can choose the PHP version and encoding
    • Next, you can also choose PHP frameworks
  • Click Finish, It creates a PHP application
  • It loads the PHP app in Netbeans.
  • Now, you are ready to work on the PHP application

PHP Plugin features in Netbeans

You can run the PHP project, by the below option

  • Run menu, select Run Project( use shortcut F6 key)
  • You can see the running project in the browser or console view

Other PHP features supported in Netbeans

  • You can also debug and test the applications, Natively Supports breakpoints, inspect for debugging
  • Provides Code Completion, Syntax Colors, Search, and code files from tab to tab
  • Supports integration with Git, SVN repositories