sayedsohail Posted September 3, 2007 Share Posted September 3, 2007 How do i make index.php as my default file to open when i typed http://localhost of my desktop. thanks Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 Paste your files in the root directory ??? and be sure to have "index.php" in DirectoryIndex of httpd.conf. Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted September 3, 2007 Author Share Posted September 3, 2007 Are you talking about this bit of httpd.conf </Directory> # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # <IfModule dir_module> DirectoryIndex index.php </IfModule> paste your files in the root directory, what do u mean by root directory? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 Yes it is that bit: DirectoryIndex: index.html index.php index.htm index.php3 index.php5 should look something like that. When u access http://localhost, ure actually accessing the root of the server. Example i have my root directory on windows: "c:\wamp\htdocs". Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted September 3, 2007 Author Share Posted September 3, 2007 how do i setup the root directory in httpd.conf? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 Look for DocumentRoot. I have it: DocumentRoot "C:/wamp/htdocs" in linux by default it should be: DocumentRoot "/var/www/html" Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted September 3, 2007 Author Share Posted September 3, 2007 i am on windows aswell, if found document root directing to htdocs and further below doucment root htdocs, you mean i should change this directing to my project directory on both of this places. # DocumentRoot: The directory out of which you will serve your DocumentRoot "C:/Program Files/Apache2.2/htdocs" and another place it says: # This should be changed to whatever you set DocumentRoot to. # <Directory "C:/Program Files/Apache2.2/htdocs"> Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 Those two lines must be changed equally. U dont have to change the DocumentRoot to match your project directory, just copy/paste your project to "C:/Program Files/Apache2.2/htdocs". Eventhough in a local environment it isnt important to test have your project in the root. U can paste your project in a directory ex: "C:/Program Files/Apache2.2/htdocs/myproject/" and access it via http with "http://localhost/myproject". Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted September 3, 2007 Author Share Posted September 3, 2007 how about in the live environment, how do i setup project directory under live application. Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2007 Share Posted September 3, 2007 The production environment will be basically the same as your local one. Instead of being in the root ex "var/www/html", ull be in ex "var/username/www/html" where html is your root as a user. Talking about shared ones as in dedicated u can do whatever u want. Copy/paste your project files in the root directory of your account by ftp and access the site by your domain or whatever. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.