Register Apache Web Server with NetBeans.
In the NetBeans IDE, select the Services tab, select Web Servers > Add Host and select Local Web Server.
Enter the correct path to Apache 2 configuration file.
The default path of the Apache configuration file, httpd.conf is: /etc/apache2/2.2.
Accept the default path for the Document Root field.
Click Finish.
The Apache 2 web server is listed under the Web Server node.
Create a PHP project using NetBeans.
Write a PHP program.
Right click on the project and select Run Project to view the output on a browser.