Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 2 down vote accepted

See these sites

http://www.howtoforge.com/ubuntu_lamp_for_newbies

http://www.ubuntugeek.com/step-by-step-ubuntu-904-jaunty-lamp-server-setup.html

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
add comment

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
add comment

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.