I created a HTML5 Project using Netbeans 7.3, but sometimes I need to run PHP code when testing locally. How do I run PHP code when testing my project locally?

The default Netbeans testing URL is localhost:8383 but this does not point to PHP-capable web server which is port 80.

Related: https://stackoverflow.com/questions/15200559/netbeans-7-3-new-html5-project-where-to-place-php-and-mvc

1 Answer 1


If you have a Windows OS, just add IIS from add/remove programs and install PHP following the instructions on their website. I've successfully done this on Windows 7.


For macs, you can try this, I've never used it but it's the first result for 'php server for mac'. Bottom line is you have to install a php server on your machine if you want to run php code locally, but it's nothing to be scared of.

2nd Update

If you already have a php server installed and configured, then it's a matter of changing your web server's listening port. So, you have two options (maybe only one because I've read that sometimes changing the default port on macs isn't possible, although I don't know why or how it's not)

1) Change the only listening port, by altering the httpd.conf file and changing the line that reads

Listen 80

2) Add a listening port, by adding a line that reads

Listen 8383

After either of these you will have to restart your httpd service on the machine.

  • How about for a Mac? (I added that tag now)
    – Hope4You
    Mar 6, 2013 at 19:17
  • Thank you, but I already have PHP installed. My question is how to run PHP files under an HTML5 project (new to Netbeans 7.3) when testing locally? Because the local testing URL Netbeans provides is port 8383 and my PHP server is on port 80.
    – Hope4You
    Mar 6, 2013 at 19:21
  • @Hope4You what are you using for PHP?
    – MDMoore313
    Mar 6, 2013 at 19:25
  • Built-in PHP on OS X Lion (Apache server)
    – Hope4You
    Mar 6, 2013 at 20:01
  • @Hope4You I've given more information.
    – MDMoore313
    Mar 6, 2013 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.