Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: http://stackoverflow.com/questions/15200559/netbeans-7-3-new-html5-project-where-to-place-php-and-mvc

share|improve this question

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.

Update

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.

share|improve this answer
    
How about for a Mac? (I added that tag now) –  Hope4You Mar 6 '13 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 '13 at 19:21
    
@Hope4You what are you using for PHP? –  BigHomie Mar 6 '13 at 19:25
    
Built-in PHP on OS X Lion (Apache server) –  Hope4You Mar 6 '13 at 20:01
    
@Hope4You I've given more information. –  BigHomie Mar 6 '13 at 20:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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