Root Directory Problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Root Directory Problem

Postby abhijitp » 02. May 2009 09:49

I want to change the default folder from xampp to myportal
I have made following changes in the httpd.conf file:

Code: Select all
# DocumentRoot "C:/xampp/htdocs" changed to
DocumentRoot "C:/xampp/htdocs/myportal"

# and <Directory "C:/xampp/htdocs"> changed to
<Directory "C:/xampp/htdocs/myportal">


but when i try to open the page using 'http://x.x.x.1/myportal ', the page opens without any formatting, images, colors etc.
abhijitp
 
Posts: 12
Joined: 18. March 2009 14:06

Re: Root Directory Problem

Postby Sharley » 02. May 2009 10:03

abhijitp wrote:but when i try to open the page using 'http://x.x.x.1/myportal ', the page opens without any formatting, images, colors etc.
Why would you use http://x.x.x.1/myportal when you have told Apache to change the DocumentRoot - http://x.x.x.1/ should find the new index file in that new DocumentRoot folder.

You are asking for a file in C:\xampp\htdocs\myportal\myportal with the URI you quoted above.

http://x.x.x.1/ = C:\xampp\htdocs\myportal\
http://x.x.x.1/myportal = C:\xampp\htdocs\myportal\myportal\
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby abhijitp » 02. May 2009 10:11

problem persists with http://x.x.x.1/ as well.

The root of myportal is c:\xampp\htdocs\myportal

please help, its a bit urgent
abhijitp
 
Posts: 12
Joined: 18. March 2009 14:06

Re: Root Directory Problem

Postby Sharley » 02. May 2009 10:14

Try clearing your browser's cache (Temporary Internet Files).

Do you get the same result if you use http://localhost/ in your browser?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby abhijitp » 02. May 2009 10:19

Sharley wrote:Try clearing your browser's cache (Temporary Internet Files).

Done. Same result.

Sharley wrote:Do you get the same result if you use http://localhost/ in your browser?

Yes.
abhijitp
 
Posts: 12
Joined: 18. March 2009 14:06

Re: Root Directory Problem

Postby abhijitp » 02. May 2009 10:36

just solved the problem.

There was a file called index.php in the htdocs folder. The code was:

Code: Select all
<?php
   if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
      $uri = 'https://';
   } else {
      $uri = 'http://';
   }
   $uri .= $_SERVER['HTTP_HOST'];
   header('Location: '.$uri.'/xampp/');
   exit;
?>


Just changed the value value of $uri from xampp to myportal in the line no 8.

Thanks for the help!!
abhijitp
 
Posts: 12
Joined: 18. March 2009 14:06

Re: Root Directory Problem

Postby IamJim » 20. May 2009 12:17

Hello Sharley,

I have run across an issue, where xampp seems to have stopped working?

I also have a question regarding this please and "pathing"...that I am unsure of so I thought I would post first. In regards to first post above:

# DocumentRoot "C:/xampp/htdocs" changed to
DocumentRoot "C:/xampp/htdocs/myportal"

# and <Directory "C:/xampp/htdocs"> changed to
<Directory "C:/xampp/htdocs/myportal">


Regarding pathing?? I would suspect that any folder /htdocs would function properly?

ie... I do not need to C:/xampp/htdocs/*.*

As I could have sworn my folders under this were?? working prior with settings I never touched yet?

But ?? Just now, I goto > C:\xampp\htdocs\index.php

And ?? It is not processing... I can read the text.

I have (2) http and 1 mysql running also..

Below are screenshots of XAMPP control panel, and my task manager.

OS Win2000 Server,

Thank-you,

Jim
IamJim
 
Posts: 56
Joined: 27. April 2009 03:01

Re: Root Directory Problem

Postby Sharley » 20. May 2009 12:45

But ?? Just now, I goto > C:\xampp\htdocs\index.php
You can't just open a php file using a path in your browser or double clicking on it a folder.

You need to have a web server parse the php code:
http://localhost/index.php
will have it working for you if you have Apache running.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby IamJim » 20. May 2009 12:51

Thank-you!! For the reply..

1) http://localhost >> = http://localhost/xampp/splash.php

Just fine.

2) I can "swear" that when I first installed xampp, and while in my editor..I could "preview" any php file and it would run?? Or just by clicking on it to OPEN in IE?

I was the one with Admin problem during Install, but I went back to ADMIN mode...and issue still exists.

3) Here is my path to where I located my working files: http://localhost/xampp/tefljobs

===

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
05/20/09 06:51:01
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
IamJim
 
Posts: 56
Joined: 27. April 2009 03:01

Re: Root Directory Problem

Postby Sharley » 20. May 2009 12:58

Here is my path to where I located my working files: http://localhost/xampp/tefljobs

http://localhost/ = C:\xampp\htdocs\

http://localhost/xampp/tefljobs/ = C:\xampp\htdocs\xampp\tefljobs\

http://localhost/tefljobs/ = C:\xampp\htdocs\tefljobs\

Does the above help you understand the path tree in XAMPP?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby IamJim » 20. May 2009 13:17

Ahh, yes..THANK-YOU !!

I do have a question? I am sure you have used an editor...and used "Preview" > Favorite Browser.

How may I set up my "path" for XAMPP to reconize this? So that I may just "click" and it should open?

As in Windows, I would just add/edit PATH to make it global scope.

I hope you understand?

Thank's again!!

Jim
IamJim
 
Posts: 56
Joined: 27. April 2009 03:01

Re: Root Directory Problem

Postby Sharley » 20. May 2009 13:38

What you are seeking to do works quite well with client side HTML and JavaScript coded pages as the browser parses the code without the need to go through a server to preview it's code and content.

However, a .php coded page is a server side language and needs to be parsed by a server to translate the code into a form the browser and you can read.

A text editor will allow you to create and edit php code but the text editor would still need to send the file for preview through a running web server to translate the code.

So in any editor the server has to be defined in it's configuration and the server has to be running for a .php file to be previewed by the editor passing the php file through the server.

I hope the above helps.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby mewbie » 22. May 2009 08:00

Wow, I know how IamJim feels. All was working fine here, was doing a bit of reading to try to find some info on a problem I'm having. I saw the links and instructions about going through server to open php files up, so I click on the links posted: http://localhost/index.php I get error and since clicking on that link when I try to open my bookmarked XAMPP Version 1.7.1: http://localhost/xampp/index.php I get same error. I have opened and used this bookmark for 2 days, fully functioning, changed root passwords, looked at samples, etc etc , haven't edited, changed any files. I close firefox, manually cleared all Temp and Temporary Internet Files , stopped/started apache, mysql.
Try to open the default bookmark again, error:
Warning: include(lang/jp=.php) [function.include]: failed to open stream: No such file or directory in D:\xampp\htdocs\xampp\index.php on line 12

Warning: include() [function.include]: Failed opening 'lang/jp=.php' for inclusion (include_path='.;D:\xampp\php\pear\') in D:\xampp\htdocs\xampp\index.php on line 12

Same if I open: http://localhost/xampp/
I can though still open up the 'RogioBiz PHP File manger': file_manager.php

So frustrated with myself, about to just chuck it all :(

Edit: I forgot to say the problem that I was having and why reading here is: On the control panel application when I click on the 'Admin' for Apache, a page opens with that same error above.
Button for mysql Admin - works just fine (opens admin page).
Last edited by mewbie on 22. May 2009 08:20, edited 1 time in total.
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Re: Root Directory Problem

Postby Sharley » 22. May 2009 08:18

Perhaps you have run a disk cleanup utility recently which may have deleted temporary files and zero length files all of which will cause issues with XAMPP - there are hundreds od files in XAMPP that have a zero length which are very much needed by XAMPP.

Check that you have a file called lang.tmp in the \xampp\htdocs\xampp folder.

If not then create a new one in your text editor.

Open your text editor and type en on the first line (if your language is English) then save the file as lang.tmp into the above \xampp\htdocs\xampp folder .

You can also create a blank file and name it lang.tmp as XAMPP will ask you for your language again and add the language code for you in to the lang.tmp file.

Now try again and hopefully you won't get an error.

BTW have your disk cleanup utility bypass the XAMPP installation folder or don't delete .tmp files in the xampp folders.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Root Directory Problem

Postby mewbie » 22. May 2009 08:33

Wow, thank you lightning fast reply :D !!!
I do have \xampp\htdocs\xampp\lang.tmp, on it was: jp=
So i removed this, left it blank. Opened bookmark again, all beautiful! On file now is as you said: en
I shall remember this trick haha!
Thank you, admin button now works as well.

I didnt run any disk cleanup, scan, or anything of the sort. I though did run a program called 'Acunetix Web Scanner' off firefox tool bar (during install it placed there) while I had my bookmarked default page open, then went to read post. As far as I know this program just reports security errors on your website, but doesn't change anything??, though today is first time playing with the software. Related to this error or change in lang.tmp file, I just don't know.


Thank you again!
mewbie
 
Posts: 13
Joined: 21. May 2009 02:43

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests