I Installed Xampp on Windows XP but I'm Having Trouble, Plz

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

I Installed Xampp on Windows XP but I'm Having Trouble, Plz

Postby youradrenalinefix » 03. January 2013 13:26

Hi everyone,

This is my first post here and I'm a novice webmaster but I'm hoping someone could please help me with getting xampp configured to do what I have in mind.

I have a folder on my computer which houses all of my website projects (c:\somefolder/anotherfolder/thefolderiwanttouse/) but when I open one of these files on my local machine (index,php for example) with xampp running, as well as with Apache and MySQL running and I try to preview the page in a browser, It just doesn't "Work".

Surely there's a way to do what I want (some tutorials I'm watching have everything happening from c:\xampp/htdocs but I want to be able to preview pages from c:\somefolder/anotherfolder/thefolderiwanttouse/somewebpage.php )

If anyone could so kindly point out what I need to do to enable this, I'd be most appreciative and I thank you all in advance!!

Stuart K
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Nobbie » 03. January 2013 14:15

You cannot enter Pathnames like "c:/folder/scipt.php" into your Browser, because the Browser will open the corresponding file directly from disk, instead of requesting it from the local Apache. Instead you must enter a valid URL which usually starts with the "protocoll" http: and is followed by two slashes and a valid servername (i.e. Domainname), in your case the "localhost", which yields to the locally installed Apache:

http://localhost (for example).

In the configuration file httdp.conf you have to supply a "DocumentRoot", this is the default pathname, where you have to install your scripts and files, if you want to request these via Apache. If you enter

http://localhost/myfile.html (for example)

Apache will fullfill this request by loading myfile.html from c:/xampp/htdocs, that is because the above mentioned "DocumentRoot" has been assigned to c:/xampp/htdocs in your httdp.conf file (you may edit this file and see the configuration).

You also may supply subfolder to the URL, like http://localhost/myfolder/myfile.html, this will result in c:/xampp/htdocs/myfolder/myfile.html

And that is the point, where your problem begins: your own folder c:/somewhere is out of the scope of the DocumentRoot - anyway what you enter into the Browser, it is impossible to reach this folder c:/somewhere, because you cannot enter this Path into the Browser (as mentioned above, then the files are not delivered by Apache) and if your enter http://localhost/blablabla, all files will be expected beyond c:/xampp/htdocs.

But: there is a simple solution for that and it is called ALIAS. "ALIAS" is a configuration directive similar to DocumentRoot, you have to enter it in httpd.conf and it has a similar meaning like DocumentRoot. The big difference: there is only one DocumentRoot per Domain, but you may have as many ALIAS as you want. How does it work? The syntax of ALIAS is very simple, I will give an example:

ALIAS /myalias c:/myfolder

This defines the ALIAS "/myalias" which yields to c:/myfolder

If you enter now http:/localhost/myalias/myfile.html into your browser, Apache recognizes the Alias /myalias in your URL, and therefore the file myfile.html is NOT delivered from c:/xampp/htdocs/myalias (what would be the case without this ALIAS), but instead it is delivered from c:/myfolder

You got the trick? Because thats all you need. You may define your own ALIAS (and call it whatever you want, for example "/somewhere" and define it for your folder c:/somewhere):

ALIAS /somewhere c:/somewhere

Restart Apache (dont forget to do so every time you change the configuration!) and then simply enter

http://localhost/somewhere/index.hmtl

into your browser and the index.html from c:/somewhere will be delivered (and not from c:/xampp/htdocs/somewhere). Or, like in your case, you may also supply a path containing several subfolders:

Alias /somewhere c:/somefolder/anotherfolder/thefolderiwanttouse

This matches http://localhost/somewhere to c:/somefolder/anotherfolder/thefolderiwanttouse

Attention: if your Path contains any spaces, you must supply the pathname with double quotes in httpd.conf:

Alias /somewhere "c:/one of my folders/another folder/and yet another folder"

If you miss that, Apache wont start.

For full explanation and documentation see: http://httpd.apache.org/docs/2.2/mod/mo ... html#alias
Nobbie
 
Posts: 7136
Joined: 09. March 2008 13:04

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 03. January 2013 16:39

Hi Nobbie,

It appears my last response didn't "Stick" so I'm writing again.

First of all... I'd like to say "Thanks" for such a detailed post.

This looks like a LOT to take in and process but I'll be definitely doing so in the very near future.

You've obviously explained everything VERY WELL, It's just that alot of this is above my current level of understanding so I'll be taking it in in small bites so I can understand it all.

I thank you once again and wish you the best!!

Stuart K
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 03. January 2013 17:26

Nobbie wrote:I will give an example:

ALIAS /myalias c:/myfolder

This defines the ALIAS "/myalias" which yields to c:/myfolder

If you enter now http:/localhost/myalias/myfile.html into your browser, Apache recognizes the Alias /myalias in your URL, and therefore the file myfile.html is NOT delivered from c:/xampp/htdocs/myalias (what would be the case without this ALIAS), but instead it is delivered from c:/myfolder

You got the trick? Because thats all you need.

One small addition to Nobbies very good detailed explaination:

Because that alias target directory is outside of all access rules exept the default access rule, all requests will be denied by Apache.
To avoid this, you have to define an access rule for that directory too. So the full alias configuration looks like this:
Code: Select all
ALIAS /myalias c:/myfolder
<Directory "C:/myfolder">
    Require all granted
</Directory>

(simplyfied version. Normally you would define some Options and/or Overrides too. Compare with the default DocumentRoot <Directory> Block in \xampp\apache\conf\httpd.conf ~lines 221ff)

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 04. January 2013 12:54

Umm... I've read both of your writings and I am very appreciative of the both of you offering help on this but I'm back...

Sorry but Ive read all of this and read it again but now Im just kinda paralyzed as what to do.

For starters; I dont have a line such as: ALIAS /myalias c:/myfolder in my c:\xampp\apache\conf\httpd.conf file.

I have been able to locate other instances of code within the httpd.conf file but I'm still at a loss as to what to do.

If you guys could so kindly point out exactly what I need to modify so I can access my site's pages in a developmental mode via http://localhost/folder/somepage.php I would be most appreciative and I thank you all once again!!
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 04. January 2013 16:10

youradrenalinefix wrote:For starters; I dont have a line such as: ALIAS /myalias c:/myfolder in my c:\xampp\apache\conf\httpd.conf file.

Certainly not. That is a configuration you have to do by yourself, because it is your requirement that exceeds the default behavior with XAMPP.
Normally XAMPPs Apache expects all requestable files inside its DocumentRoot folder (\xampp\htdocs\) or inside subfolders of that.
That is not what you want, so you have change the configuration.

youradrenalinefix wrote:I have been able to locate other instances of code within the httpd.conf file but I'm still at a loss as to what to do.

Well, everything needed is already posted here at the thread. I have no clue how we can help you more than that.
You can simply take the code from my last posting here, replace the folders with the folder where your files are saved, copy all of that at the end of your \xampp\apache\conf\httpd.conf, save the file and restart your Apache and it should work.

youradrenalinefix wrote:If you guys could so kindly point out exactly what I need to modify so I can access my site's pages in a developmental mode via http://localhost/folder/somepage.php I would be most appreciative and I thank you all once again!!

assumed your real foldername would be c:\somefolder\anotherfolder\thefolderiwanttouse\ and you want to use the alias folder/ to request your files like http://localhost/folder/somepage.php, the configuration block you need could look like this:
Code: Select all
<IfModule alias_module>
    Alias /folder "C:/somefolder/anotherfolder/thefolderiwanttouse/"
    <Directory "C:/somefolder/anotherfolder/thefolderiwanttouse">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</IfModule>

That is the code you need to place inside your httpd.conf file, although there are always multiple correct ways to do a thing. This is just one of them.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 04. January 2013 16:16

One More Question before I get started going deeper into this (and while it appears you're online) WHERE in the httpd.conf file do I place the block of code you posted below?

<IfModule alias_module>
Alias /folder "C:/somefolder/anotherfolder/thefolderiwanttouse/"
<Directory "C:/somefolder/anotherfolder/thefolderiwanttouse">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</IfModule>

Sorry about any headache Ya'll... It's just intimidating to me and I want to make sure I do things properly.
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 04. January 2013 16:19

youradrenalinefix wrote:One More Question before I get started going deeper into this (and while it appears you're online) WHERE in the httpd.conf file do I place the block of code you posted below?

I have already written this. Let me quote myself:
Altrea wrote:... all of that at the end of your \xampp\apache\conf\httpd.conf ...

But thats just an example. The position of that block is not that important.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 07. January 2013 13:44

Hi Guys... I'm back again...
Sorry for any headache but I'm just trying to get setup

Ok... I put:

ALIAS /myalias c:/myfolder
<Directory "C:/myfolder">
Require all granted
</Directory>

at the bottom of C:/xampp/apache/conf/httpd.conf and changed my folders accordingly (file names have spaces and im using double quotes) so my code looks just like this (actual filenames obscured as I believe posting them here could create a SERIOUS security risk to the data on my computer)

But here's what my code looks like (now):

ALIAS /myalias "c:/first folder/second folder/target folder"
<Directory "C:/first folder/second folder/target folder">
Require all granted
</Directory>


but when I try entering localhost/somefile.html or localhost/anotherfile.php or even; localhost/first folder/second folder/target folder/somefile.html or localhost/first folder/second folder/target folder/somefile.html I am getting Object Not Found!

I have also restarted Apache numerous times (as I've tried numerous small changes to the code) but I just can't get it to work.

If you guys could so kindly point out what I'm doing wrong I would be most appreciative and I thank you guys once again!!

Stuart K
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 07. January 2013 14:39

What information does the \xampp\apache\logs\error.log give you?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 07. January 2013 15:10

I hope it's not more than you asked for but...

Code: Select all
[Mon Jan 07 07:22:13.281250 2013] [core:warn] [pid 1760:tid 184] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jan 07 07:22:13.640625 2013] [ssl:warn] [pid 1760:tid 184] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:22:15.625000 2013] [mpm_winnt:notice] [pid 1760:tid 184] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Mon Jan 07 07:22:15.640625 2013] [mpm_winnt:notice] [pid 1760:tid 184] AH00456: Server built: Aug 18 2012 12:41:37
[Mon Jan 07 07:22:15.640625 2013] [core:notice] [pid 1760:tid 184] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jan 07 07:22:15.671875 2013] [mpm_winnt:notice] [pid 1760:tid 184] AH00418: Parent: Created child process 4092
[Mon Jan 07 07:22:16.843750 2013] [ssl:warn] [pid 4092:tid 1888] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:22:17.046875 2013] [mpm_winnt:notice] [pid 4092:tid 1888] AH00354: Child: Starting 150 worker threads.
[Mon Jan 07 07:25:35.562500 2013] [core:warn] [pid 5268:tid 184] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jan 07 07:25:35.843750 2013] [ssl:warn] [pid 5268:tid 184] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:25:35.984375 2013] [mpm_winnt:notice] [pid 5268:tid 184] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Mon Jan 07 07:25:35.984375 2013] [mpm_winnt:notice] [pid 5268:tid 184] AH00456: Server built: Aug 18 2012 12:41:37
[Mon Jan 07 07:25:35.984375 2013] [core:notice] [pid 5268:tid 184] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jan 07 07:25:36.000000 2013] [mpm_winnt:notice] [pid 5268:tid 184] AH00418: Parent: Created child process 5320
[Mon Jan 07 07:25:37.359375 2013] [ssl:warn] [pid 5320:tid 1888] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:25:37.500000 2013] [mpm_winnt:notice] [pid 5320:tid 1888] AH00354: Child: Starting 150 worker threads.
[Mon Jan 07 07:26:48.609375 2013] [core:warn] [pid 4804:tid 184] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jan 07 07:26:48.843750 2013] [ssl:warn] [pid 4804:tid 184] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:26:48.984375 2013] [mpm_winnt:notice] [pid 4804:tid 184] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Mon Jan 07 07:26:48.984375 2013] [mpm_winnt:notice] [pid 4804:tid 184] AH00456: Server built: Aug 18 2012 12:41:37
[Mon Jan 07 07:26:48.984375 2013] [core:notice] [pid 4804:tid 184] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jan 07 07:26:49.000000 2013] [mpm_winnt:notice] [pid 4804:tid 184] AH00418: Parent: Created child process 4844
[Mon Jan 07 07:26:50.125000 2013] [ssl:warn] [pid 4844:tid 1888] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:26:50.281250 2013] [mpm_winnt:notice] [pid 4844:tid 1888] AH00354: Child: Starting 150 worker threads.
[Mon Jan 07 07:29:29.390625 2013] [core:warn] [pid 6012:tid 184] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jan 07 07:29:29.578125 2013] [ssl:warn] [pid 6012:tid 184] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:29:29.734375 2013] [mpm_winnt:notice] [pid 6012:tid 184] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Mon Jan 07 07:29:29.734375 2013] [mpm_winnt:notice] [pid 6012:tid 184] AH00456: Server built: Aug 18 2012 12:41:37
[Mon Jan 07 07:29:29.734375 2013] [core:notice] [pid 6012:tid 184] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jan 07 07:29:29.734375 2013] [mpm_winnt:notice] [pid 6012:tid 184] AH00418: Parent: Created child process 6048
[Mon Jan 07 07:29:30.921875 2013] [ssl:warn] [pid 6048:tid 1888] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:29:31.078125 2013] [mpm_winnt:notice] [pid 6048:tid 1888] AH00354: Child: Starting 150 worker threads.
[Mon Jan 07 07:31:40.484375 2013] [core:warn] [pid 4928:tid 184] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jan 07 07:31:40.687500 2013] [ssl:warn] [pid 4928:tid 184] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:31:40.843750 2013] [mpm_winnt:notice] [pid 4928:tid 184] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Mon Jan 07 07:31:40.843750 2013] [mpm_winnt:notice] [pid 4928:tid 184] AH00456: Server built: Aug 18 2012 12:41:37
[Mon Jan 07 07:31:40.843750 2013] [core:notice] [pid 4928:tid 184] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Jan 07 07:31:40.843750 2013] [mpm_winnt:notice] [pid 4928:tid 184] AH00418: Parent: Created child process 4880
[Mon Jan 07 07:31:41.953125 2013] [ssl:warn] [pid 4880:tid 1888] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Jan 07 07:31:42.109375 2013] [mpm_winnt:notice] [pid 4880:tid 1888] AH00354: Child: Starting 150 worker threads.
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 07. January 2013 17:55

oh sorry, i meant the \xampp\apache\logs\access.log file :D
Especially the parts with your 404 errors
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby hackattack142 » 08. January 2013 03:08

ALIAS /myalias "c:/first folder/second folder/target folder"
<Directory "C:/first folder/second folder/target folder">
Require all granted
</Directory>


but when I try entering localhost/somefile.html or localhost/anotherfile.php or even; localhost/first folder/second folder/target folder/somefile.html or localhost/first folder/second folder/target folder/somefile.html I am getting Object Not Found!


If you put /myalias as your alias and you have somefile.html in your target directory, you need to access it by http://localhost/myalias/somefile.html for example.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 703
Joined: 20. May 2011 23:29
XAMPP Version: 5.6.3
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby youradrenalinefix » 08. January 2013 12:37

Hi Guys,

I'm almost there and I really appreciate your help!!

@Altrea... I was going to send you these logs but when I came to the computer this AM and saw hackatack142's post and tried entering http://localhost/myalias/ it returns my Home Page (index.html) YAYYYYY!!! (HUGE Thanks to hackattack142 BTW) But... I'm having trouble.

Even though it displays the content and images on the page, none of the other functions are working (CSS, Include files etc)

I'm fairly certain that this is because all this is enclosed in php include tags <?php include ('filewithcsstag.php') ?> and Apache isn't opening / accessing these files.

Well that brings me back here.

What do I do to correct this??

Again... I really appreciate everyone's help and I thank you all!!

Stuart K
youradrenalinefix
 
Posts: 17
Joined: 03. January 2013 13:16
XAMPP Version: 5.6.3
Operating System: Windows Home XP

Re: I Installed Xampp on Windows XP but I'm Having Trouble,

Postby Altrea » 08. January 2013 17:56

youradrenalinefix wrote:when I came to the computer this AM and saw hackatack142's post and tried entering http://localhost/myalias/ it returns my Home Page (index.html) YAYYYYY!!! (HUGE Thanks to hackattack142 BTW)

:shock: I haven't seen the obvious solution :D

youradrenalinefix wrote:I'm fairly certain that this is because all this is enclosed in php include tags <?php include ('filewithcsstag.php') ?>

Yes and no. The issue is that Apache doesn't have any reason to send .html files to the php interpreter. For Apache .html files are plain text only which are sended nearly directly to the clients browser.

youradrenalinefix wrote:What do I do to correct this??

The recommend solution would be to change all file extensions that contain php code to .php

The not recommend solution would be to teach Apache to send even .html files through the php interpreter.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6946
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: Windows 10 Pro x64

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: atrdriver and 72 guests