How To Install NetBeans 11 for PHP on Windows

How To Install NetBeans 11 for PHP on Windows

Explains all the steps required to install NetBeans 11 on Windows for PHP development and write the first PHP program i.e. Hello World.

May 05, 2019

In this tutorial, we will discuss the steps required to install Incubating NetBeans 11 on Windows for PHP development. The incubating versions of NetBeans i.e. 9, 10, and 11 do not come with an officially released installer, hence we can either build it from the source or use the binary files provided by Apache. We will discuss the installation steps required to install it using the binary files distributed by Apache and write our first PHP program i.e. Hello World.

This tutorial assumes that appropriate Java and PHP are already installed on the system. You can follow the steps to install Java 10, Java 11, or OpenJDK 12 published by Tutorials24x7. You can also follow How To Install PHP 7 On Windows, and How To Install WampServer on Windows to install PHP on Windows. The steps to install NetBeans 10 and NetBeans 11 on other versions of Windows should be similar to the steps mentioned in this tutorial.

You can also follow How To Install NetBeans 11 for PHP on Ubuntu to install NetBeans 11 on Ubuntu.

Notes: You can also follow the newer version of this tutorial How To Install NetBeans 12 for PHP on Windows using Windows installer. You may also be interested in our debugging tutorials to debug PHP. These include How To Debug PHP In NetBeans On Windows, How To Debug PHP Web Apps In NetBeans On Windows, and How To Remote Debug PHP Web Apps In NetBeans On Windows.

Download NetBeans 11

Open the Download Page to download Apache NetBeans (incubating) 11.0. You can also directly follow this link in order to download NetBeans 11 from the mirror sites.

Download NetBeans 11

Fig 1

Click on the binaries link as highlighted in Fig 1. Also, verify your download by following the highlighted instructions.

Install NetBeans 11

Extract the downloaded binaries at the appropriate location and also create a desktop shortcut of the executable(.exe) file in order to execute NetBeans from the Desktop. The NetBeans 11 provides both 32-bit and 64-bit executables as shown in Fig 2.

NetBeans 11 Executables

Fig 2

Execute NetBeans 11

Now execute NetBeans 11 either from the extract location or using the Desktop Shortcut as created in the previous step. It might ask to import settings from the previous installation of NetBeans as shown in Fig 3.

Previous Settings

Fig 3

Click on the No Button to have a fresh installation. You may click on Yes Button in order to import the settings from the previously installed version of NetBeans. It will show the welcome screen as shown in Fig 4.

Welcome Screen

Fig 4

Create PHP Project

In this step, we will create our first PHP project using NetBeans 11.

Click on File Option on Main Menu and then click on New Project. It will open the New Project Wizard as shown in Fig 5.

Create Project Wizard

Fig 5

Select PHP from the Categories options and also select PHP Application from Projects options as shown in Fig 5. The NetBeans 11 will show a message in the description section to enable appropriate plugins required for PHP development, in case it's the first project. Now click the Next Button. On the next wizard, NetBeans will find the corresponding plugins required for PHP development and shows the options as shown in Fig 6.

PHP Features

Fig 6

Click on the Download and Activate Button to download the NetBeans plugins including PHP, HTML, and JavaScript. The installer will also show a dialog to accept the License Agreement for Oracle JS Parser Implementation as shown in Fig 7.

Oracle JS Parser Implementation Agreement

Fig 7

Click on Next Button and accept the License Agreement as shown in Fig 8.

Acccept Oracle License Agreement

Fig 8

Click on the Finish Button to complete the plugin installation. After the installer is done with installing all the required plugins, it will show the wizard to configure the project name and location as shown in Fig 9.

Configure PHP Project

Fig 9

Provide the Project name and location based on your requirements and also select the PHP version. I have selected PHP 7.3 since it's already installed on my system. You can follow How To Install PHP 7 On Windows to install the most recent version of PHP. Now click on the Next Button. The next wizard provides options to choose the project's runtime configurations. I have selected Script for this tutorial as shown in Fig 9. It also asks for the corresponding PHP Interpreter to execute the program for the Script Option. The configuration in my case should be similar to the one as shown in Fig 10.

Configure PHP Interpreter

Fig 10

Apart from Script Option to run PHP program on the console, there are few more options specific to Runtime including Local Web Site, Remote Web Site, and PHP Built-in Web Server. This tutorial does not discuss the additional Runtime configuration. After selecting the Script as a Runtime option, we can also select the location where PHP is installed.

Now click on the Apply Button. You can also configure the PHP Framework from Frameworks & Tools Tab as shown in Fig 11.

Frameworks and Tools

Fig 11

Now click on the OK Button to complete the project creation step. Click on Next Button. The next wizard will ask to select the PHP Framework as shown in Fig 12. We will simply skip this step since we will be writing a simple HelloPHP program in this tutorial.

Framework Selection

Fig 12

Click the Next Button. The next wizard shows options to configure the project for Composer as shown in Fig 13.

Composer Configuration

Fig 13

We will leave it blank and click on the Finish Button. The project with default index.php file created by NetBeans looks like the one shown in Fig 14.

Default Project Files

Fig 14

Hello PHP

In this step, we will update the index.php program and execute it on the console. Write Hello PHP as shown below.

<?php
echo "Hello PHP !!";

Now right-click on the index.php file in the Projects Window on the left panel. Also, click on Run to execute the program. You can also select the File on Projects Window and press Shift + F6 to execute the program. It will show the output as shown in Fig 15.

Hello PHP

Fig 15

These are the basic steps required to install NetBeans 11 for PHP development on Windows.

Write a Comment
Click the captcha image to get new code.
Discussion Forum by DISQUS