You set up Netbeans, but have you actually installed PHP on your machine?
Netbeans is just an IDE, it helps you write code and find errors, with code hinting, etc. To actually run anything written in PHP you need to install the PHP parser on your machine. Typically, this is installed as a web server module.
You've not said what type of machine you're using, but installing PHP and Apache is very simple. There are pre-built installations that you can use on Windows (EasyPHP or Xampp) and MacOS (Mamp) and on Linux you can just install Apache and PHP through your package manager and it will configure them both for you.