LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where to save the php and html files on apache (http://www.linuxquestions.org/questions/linux-newbie-8/where-to-save-the-php-and-html-files-on-apache-736812/)

Zepyr 06-30-2009 08:35 PM

Where to save the php and html files on apache
 
Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr

Tinkster 06-30-2009 09:06 PM

Hi, welcome to lq!
Quote:

Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr
Wherever the servers document root is. And that will be in your apache configuration;
the name and location of which will depend on the distro you've chosen....


Cheers,
Tink

frankbell 06-30-2009 11:00 PM

In most apache installations, the default location for your website files is the htdocs subdirectory.

I use the Xampp stack, and the files that are visible over the web go in /opt/lampp/htdocs.

You can change this, but there's no good reason to.

chrism01 07-01-2009 01:49 AM

We need to know which Linux distro & version you've got.
However, if you look in the Apache httpd.conf, the DocumentRoot directive is normally where you would start.
See the docs here for more info: http://httpd.apache.org/

linuxlover.chaitanya 07-01-2009 01:59 AM

Quote:

Originally Posted by Zepyr (Post 3592264)
Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr

That depends on the distribution you are using. If you are putting up your server on RH or Fedora based distros then you might want to put it in /var/www/html by default. But that is by default. You can change the apache configuration.
For Ubuntu based systems that could be /var/www. Again that depends on the apache configuration. You can change that and make your php files reside where you want them to.

rylan76 07-01-2009 04:16 AM

Did you use a package manager to get apache, or did you compile it yourself?

IME, for example, compiling Apache 2.0.54 yourself with a standard configuration and installing it will make the htdocs folder be in /usr/local/apache2/htdocs


All times are GMT -5. The time now is 08:58 AM.