How To Install NetBeans 12 for PHP on Ubuntu 20.04 LTS

PHP
By bhagwatchouhan
How To Install NetBeans 12 for PHP on Ubuntu 20.04 LTS

In this tutorial, we will discuss the steps required to install NetBeans 12 on Ubuntu 20.04 LTS for PHP development. It provides 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 ( 8 or 11) and PHP are already installed on the system. You can follow How To Install PHP On Ubuntu 20.04, How To Install PHP 8 On Ubuntu 20.04 LTS, How To Install Java 11 On Ubuntu, How To Install Java 17 On Ubuntu 20.04 LTS, and How To Install OpenJDK 17 On Ubuntu 20.04 LTS.

 

You can also follow How To Install NetBeans 12 for PHP on Windows to install NetBeans 12 on Windows.

 

Download NetBeans 12

 

Click Here to visit the download page having appropriate download links and instructions to verify the download as shown in Fig 1.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Download Options

Fig 1

 

Now click the Download Button as highlighted in Fig 1. It provides the links to download the installer for Ubuntu as highlighted in Fig 2.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Download

Fig 2

 

Click the Download Link as highlighted in Fig 2. It will show the download mirrors as shown in Fig 3.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Download Mirrors

Fig 3

 

Now click the suggested link to start downloading NetBeans 12 for Ubuntu 20.04 LTS.

 

Launch NetBeans 12 Installer

 

Navigate to the directory where NetBeans 12 file has been saved and execute the below-mentioned commands to launch the installer. I have downloaded the file Apache-NetBeans-12.5-bin-linux-x64.sh while writing this tutorial.

 
# Change Permissions
sudo chmod +x Apache-NetBeans-12.5-bin-linux-x64.sh

# Launch Installer
sudo ./Apache-NetBeans-12.5-bin-linux-x64.sh

 

It shows the Welcome Screen as shown in Fig 4.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installer - Welcome Screen

Fig 4

 

You may customize the components by clicking the Customize Button. It provides the options to choose the components as shown in Fig 5.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installer - Customize Options

Fig 5

 

Click the OK Button after selecting the appropriate components. Now click the Next Button to continue the installation. It provides the options to accept the License Agreement as shown in Fig 6.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installer - License Agreement

Fig 6

 

Accept the License Agreement as shown in Fig 6, and click the Next Button. The next screen provides the options to configure the installation path and choose the JDK as shown in Fig 7.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installation Path

Fig 7

 

You may change the installation path of JDK if required. Now click the Next Button to continue the installation. The next screen shows the installation summary as shown in Fig 8.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installation Summary

Fig 8

 

Click the Install Button to finalize the installation. It shows the installation progress as shown in Fig 9.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installation Progress

Fig 9

 

The installer shows the success message on completing the installation as shown in Fig 10.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Installation Success

Fig 10

 

Now click the Finish Button to close the installer. This completes the installation of NetBeans 12 on Ubuntu 20.04 LTS. Click the Settings Icon at the bottom left to confirm whether NetBeans was installed successfully. It should show the Application Icon as shown in Fig 11.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Confirm Installation

Fig 11

 

Click the NetBeans Icon to launch the IDE. It shows the default Start Page as shown in Fig 12.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Start Page

Fig 12

 

Create PHP Project

 

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

 

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

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - New Project Options

Fig 13

 

Select PHP from the Categories options and also select PHP Application from Projects options as shown in Fig 13. The NetBeans 12 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 to configure Name and Location as shown in Fig 14.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Project Name and Location

Fig 14

 

Provide the Project name and location based on your requirements and also select the PHP version. I have selected PHP 8 installed on my system. You can follow How To Install PHP 8 On Ubuntu 18.04 LTS. 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 15. 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 shown in Fig 15.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Run Configuration

Fig 15

 

Apart from the 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.

 

Click the Next Button. The next wizard will ask to select the PHP Framework as shown in Fig 16. We will simply skip this step since we will be writing a simple HelloPHP program in this tutorial.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - PHP Frameworks

Fig 16

 

Click last time on the Next Button. The next wizard shows options to configure the project for Composer as shown in Fig 17.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Composer

Fig 17

 

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

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Index

Fig 18

 

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 the index.php file in the Projects Window on the left panel. Also, click the Run Option 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 19.

 

Install NetBeans 12 for PHP On Ubuntu 20.04 - Output

Fig 19

 

These are the basic steps required to install NetBeans 12 for PHP development on Ubuntu systems.

 

Summary

 

This tutorial provided all the steps required to install the most recent version of NetBeans 12 on Ubuntu 20.04 LTS. It also provided the steps required to create the first PHP project and execute the first PHP script.

Share this blog:

Profile picture for user bhagwatchouhan
bhagwatchouhan