Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I followed that site and installed php on my ubuntu 11.04. I'm using net beans 7 rc1 to develop programs. A small problem in php. as per that installation it specifies that php files should save in "/var/www" this works good i checked.

But prob is when using netbeans php files are defaultly saved in /home/usr/netbeansproject/... something like this so that directly i can't able to run it. Each and every time i transfered php files in /var/www to run it. I tried something to change in netbeans but i can't do that properly. Can anyone help me to change that directory either from php side or netbens. (step by step thnks guys.....)

share|improve this question
You might want to check out What is the best way to add files to a website on a LAMP server? – Marco Ceppi Jun 4 '11 at 23:57

I'm not so sure about netbeans, but for normal websites, I prefer to symlink to actual folders that I need to be hosted inside the www directory.

For eg :

/var/www/project_name -> /home/usr/netbeansproject/project_name/

I do this for all my websites on my laptop.

share|improve this answer

When saving a file or creating a project, you'll have to specify the "Sources folder" in th dialog that appears.

For instance when you create a new PHP project: File > New Project - Then you select PHP and PHP Application and click "Next >". The next part is where you specify the project name and the folder you want it to be saved in.

NetBeans is built to handle projects, and it works best that way.

Another option would be to change the settings of your web server. You would do this by changing the "/var/www" paths in httpd.conf to the Netbeans default directory. I am not sure where you'll be able to find it the way you installed it though. You might find it in /etc/apache2 or something similar.

I'm using XAMPP (LAMPP) and my httpd.conf file is located in /opt/lampp/etc/httpd.conf.

share|improve this answer

I wrote all you need here so not to repeat my self here you go.

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Kris Harper Sep 2 '11 at 17:04

Your Answer


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.