Dan
Dan

Reputation: 63

How can I run things off Netbeans on Ubuntu? Localhost not working

When I try to run something on Netbeans using Ubuntu, a window opens but nothing actually works. I'm pretty sure it's because my http://localhost/ isn't working. So, how do I get that to work so I run files on Netbeans? Any specific step-by-step instructions would be great. I heard I had to install Apache, but I'm not sure.

Upvotes: 0

Views: 984

Answers (1)

Radoslav Georgiev
Radoslav Georgiev

Reputation: 1376

If you want to run PHP stuff outside NetBeans, there are several steps you have to take:

  1. Install apache web server - sudo apt-get install apache2
  2. Install PHP and connect it with apache - sudo apt-get install php5 sudo apt-get install libapache2-mod-php5
  3. Restart apache - sudo /etc/init.d/apache2 restart

Now, your Document Root (web root) should be at /var/www. Place your files there and access them with http://localhost/desired_file.php with some web browser or just execute them with php compiler on the command line.

Depending on your distro/version, there might be some configurations to be done, but that's the basic stuff you need to run PHP outside NetBeans

Upvotes: 1

Related Questions