Server Fault is a question and answer site for system and network administrators. 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 just got Apache to run. Now I need to install php and make a development environment. When I will need to place php files to be run on the server, is there a directory like "src" that I should create and place my php scripts there? Or what is the good-practice way of doing this sort of thing?

Thanks, Alex

share|improve this question
What Operating system? – JeffG Mar 22 '11 at 21:46
Ubuntu Operating System – Genadinik Mar 22 '11 at 21:48
up vote 2 down vote accepted

See these sites

They will step you through the whole process, including getting a database setup.

share|improve this answer
That tutorial was helpful. But it left me with an error on the last step which is basically a "page not found" when I try to get to the php file via the browser. Can it be an apache thing rather than a PHP problem? Maybe a paths issue? the .php file is in /var/www/ and I try to access it with localhost/filename.php – Genadinik Mar 22 '11 at 22:04
It could be any of several things... what error do you get in the Apache log files at the same time the request fails? – JeffG Mar 23 '11 at 16:25

Apache has a so called document root. On Ubuntu this is /var/www/.

When you visit the server in your browser, the default/var/www/index.html file is served to you.

If you want to serve some php scripts, this is the directory where you'd want to place them.
You could for example replace the default index.html file in the document root with your own index.php.

share|improve this answer

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.