Page 1 of 1

xampp php running/not running?

PostPosted: 17. February 2012 18:16
by pitchwest
Windows 7.I've tried: Install, un-install... over and over. Changing the localhost to my IP in the file httpd. Running without a firewall.
In xampp, I check statues and it says php is running fine, but when I check the file located in the htdoc file "index.php" all I see is the code... meaning it's not working. It seem there are lots of forums to this problem, and though, they get it fixed, there's not to many answers. I hope that this thread will find a simple answer.

My walk through: Download xampp, install, runs apache and Mysql automatically, open index.php from htdoc, doesn't work. Go to browser, localhost/xampp/index, check statues, Mysql database, php, https(ssl), CGI, SSI, ACTIVATED... smtp, ftp, tomcat, DEACTIVATED.

Since most of the time the problem is the user, it must be me doing something wrong or not doing something right.

Re: xampp php running/not running?

PostPosted: 17. February 2012 18:30
by JonB
1. - You should look in the Apache error log to see if there is an indication of what is wrong.
\xampp\apache\logs\error.txt

2. - What happens when you enter http://localhost in your browser.??

3. -
but when I check the file located in the htdoc file "index.php" all I see is the code... meaning it's not working.


Did you try to open it with Windows Explorer?

Good Luck
8)

Re: xampp php running/not running?

PostPosted: 17. February 2012 18:52
by pitchwest
EI: localhost works in EI, but when I try to open index.php, EI won't open it... at all. Localhost takes me to the xampp page; from either browsers.


Errors:
[Fri Feb 17 08:54:51 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Feb 17 08:54:51 2012] [notice] Digest: done
[Fri Feb 17 08:54:52 2012] [notice] Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Feb 17 08:54:52 2012] [notice] Server built: Sep 10 2011 11:34:11
[Fri Feb 17 08:54:52 2012] [notice] Parent: Created child process 2108
[Fri Feb 17 08:54:52 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Feb 17 08:54:52 2012] [notice] Digest: done
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Child process is running
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Acquired the start mutex.
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Starting 150 worker threads.
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Starting thread to listen on port 443.
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Starting thread to listen on port 443.
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Starting thread to listen on port 80.
[Fri Feb 17 08:54:53 2012] [notice] Child 2108: Starting thread to listen on port 80.

Are the things I've tried already appropriate? How I have it set up now is straight out of the box.

Re: xampp php running/not running?

PostPosted: 17. February 2012 19:53
by JonB
Uhhh - its SUPPOSED to take you to the XAMPP page. The index.php, it is a redirector.

Good Luck
8)

Re: xampp php running/not running?

PostPosted: 17. February 2012 20:43
by pitchwest
Thanks. I'm aware it's supposed to take me to the xampp page. That's not the problem. The problem is that I can't run php.... but xampp says that php is activated.

Re: xampp php running/not running?

PostPosted: 17. February 2012 21:39
by JonB
if you get to the XAMPP page - php IS running - its a PHP page...

Re: xampp php running/not running?

PostPosted: 17. February 2012 22:05
by pitchwest
I know. That is way I'm having such a hard time with this. When I open this:

<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
Something is wrong with the XAMPP installation :-(

from htdoc, I see this:

<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
Something is wrong with the XAMPP installation :-(

Re: xampp php running/not running?

PostPosted: 17. February 2012 22:19
by Altrea
You can't "open" files directly in your browser.
php files have to be processed by a php interpreter and your browser can't know, that you have a php interpreter somewhere on your machine.

Instead of open files directly, you must request them with the help of the http protocol.

e.g. if you want to request your \xampp\htdocs\index.php file, the correct url is http://localhost/index.php

another example: if you want to request \ampp\htdocs\projectxy\site.php the url would be http://localhost/projectxy/site.php

best wishes,
Altrea

Re: xampp php running/not running?

PostPosted: 17. February 2012 23:13
by pitchwest
I have had xampp up and running on my Master computer for a few years. I do know how to use it. That was on Vista though. I was thinking that maybe Windows 7 had some sort of Firewall issue or something. I've tried disabling the firewall and still the same problem.
When I open a php file on my other computer, I do it from the htdoc folder. I believe it runs through xampp that way.
I seem to remember having a little trouble setting xampp up the first time as well. As far as I know, I've read all the trouble shooting and haven't found my answer.
Don't give up on me fellows.

Re: xampp php running/not running?

PostPosted: 18. February 2012 00:05
by pitchwest
Altrea wrote:You can't "open" files directly in your browser.
php files have to be processed by a php interpreter and your browser can't know, that you have a php interpreter somewhere on your machine.

Instead of open files directly, you must request them with the help of the http protocol.

e.g. if you want to request your \xampp\htdocs\index.php file, the correct url is http://localhost/index.php

another example: if you want to request \ampp\htdocs\projectxy\site.php the url would be http://localhost/projectxy/site.php

best wishes,
Altrea



Thanks man. It's funny how you don't know what you don't know.
It turns out that I did need to access my php files through (http://) I had thought I was.
I have it working. What confused me the most was that the (index.php) file that I was trying to open (when I double clicked the file) would show me the code in my browser. I knew that was wrong. When I typed in my browser (localhost) and xampp page came up, I didn't realize that that was the same index.php file. I kept thinking that the xampp (though I knew it was located on my computer) was alive, connected to the Internet, through, my computer. It's not. It's completely stand alone.
On all of my other projects, I've accessed the php files once I've already established a connection to http://. So I would open an html file, and then go to a php file, and it would open fine.

Thank you everyone for your patience. It's hard listening to people try to describe things they don't know is missing.

Re: xampp php running/not running?

PostPosted: 18. February 2012 09:24
by JonB
I'm glad its working.

LOL from my first reply -
Did you try to open it with Windows Explorer?
:shock:

Good Luck with your projects...
8)