XAMPP has not installed PHP (I think?)

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

XAMPP has not installed PHP (I think?)

Postby Kangaroo32 » 17. December 2009 05:15

Hello everyone,

Thanks for deciding to help me with this. I'm very new to installing/working with databases. For the past couple hours, I've been trying to install XAMPP on my machine. I've posted my problems on another forum and the people there, after trying to help me, recommended I use "the XAMPP forum". This looks like a good place to ask for some help :). Apache seems to install correctly, as does MySQL. I'm not concerned with Perl right now. The problem lies with PHP. Because of the conversations I've been a part of before, I am going to go overboard and completely idiot-proof this to the best of my ability; I hope you guys don't mind if I spell it out. It's a reflection of my problems, not the intelligence of anyone else.



Here is my story:

1) I downloaded and scanned xampp-win32-1.7.2.exe onto my Windows XP SP2 machine.

2) I then ran the file, switching from default C:\ to D:\, so filepath is D:\xampp. This is necessary on my machine.

3) I selected add shortcuts to the startmenu/desktop with choice y.

4) Next, still in cmd, was this message:
Should I locate the XAMPP paths correctly?

Should I proceed? <y/x=exit setup>:
and I answered y.

5) Next, still in cmd, was this message:
Should I make a portable XAMPP without drive letters?

NOTE: - You should use drive letters, if you want use services.
- With USB sticks you must not use drive letters.

Your choice? <y/n>:
and I answered n.

Then cmd said XAMPP is ready to use.

6) I confirmed my timezone and then entered x to exit.

7) In the start menu, I selected XAMPP Control Panel, then started Apache and MySQL. Pressing the Admin buttons next to each returns a positive result.

There is a folder called D:\xampp\htdocs, which contains two files and one folder. They are index.html, index.php, and xampp.
Opening the .html file automatically uses FireFox and shows me a page with the text It works!.
Opening the .php file asks me to select a program from a list. I chose FireFox and got shown a page with the text Something is wrong with the XAMPP installation :-( .

I've tried uninstalling and reinstalling, and I keep getting the same results. If it's a file I have to modify, please give me an absolute filepath because there is too much going on for me to make any sense of this.


Thanks!
Kangaroo32
 
Posts: 7
Joined: 17. December 2009 04:38

Re: XAMPP has not installed PHP (I think?)

Postby thestick » 17. December 2009 05:25

do not try and open it form the explore window, open your internet browser and type localhost and there you will see the xammp start page
thestick
 
Posts: 4
Joined: 17. December 2009 05:14

Re: XAMPP has not installed PHP (I think?)

Postby Kangaroo32 » 17. December 2009 07:08

thestick wrote:do not try and open it form the explore window, open your internet browser and type localhost and there you will see the xammp start page


Thanks. That works, however php does not.
Kangaroo32
 
Posts: 7
Joined: 17. December 2009 04:38

Re: XAMPP has not installed PHP (I think?)

Postby Bill Smith » 17. December 2009 07:23

There is a folder called D:\xampp\htdocs, which contains two files and one folder. They are index.html, index.php, and xampp.


Try opening your browser and typing in "localhost/index.php".

My guess (and I'm a newbie here) is that you're trying to open the index.php file by double clicking on it, which causes your PC to try and open it using an associated program. But what you really want is to tell your browser to run the "index.php" program from the Apache server root directory (which is usually the htdocs folder.
Bill Smith
 
Posts: 7
Joined: 09. December 2009 07:14

Re: XAMPP has not installed PHP (I think?)

Postby Izzy » 17. December 2009 07:30

Kangaroo32 wrote:7) In the start menu, I selected XAMPP Control Panel, then started Apache and MySQL. Pressing the Admin buttons next to each returns a positive result.
When you get the XAMPP Welcome Demo page, which is from the Apache Admin... button you clicked on in the XCP, then that is mostly php coded - so PHP must be working.

Try the demos in the "Admin" page.

Paste your PHP code here that is not working.

Look in the \xampp\apache\logs\error.log file for any clues.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: XAMPP has not installed PHP (I think?)

Postby Kangaroo32 » 17. December 2009 09:16

Bill Smith wrote:
There is a folder called D:\xampp\htdocs, which contains two files and one folder. They are index.html, index.php, and xampp.


Try opening your browser and typing in "localhost/index.php".

My guess (and I'm a newbie here) is that you're trying to open the index.php file by double clicking on it, which causes your PC to try and open it using an associated program. But what you really want is to tell your browser to run the "index.php" program from the Apache server root directory (which is usually the htdocs folder.


This brings up the XAMPP Welcome Demo page.



Izzy wrote:
Kangaroo32 wrote:7) In the start menu, I selected XAMPP Control Panel, then started Apache and MySQL. Pressing the Admin buttons next to each returns a positive result.
When you get the XAMPP Welcome Demo page, which is from the Apache Admin... button you clicked on in the XCP, then that is mostly php coded - so PHP must be working.

Try the demos in the "Admin" page.

Paste your PHP code here that is not working.

Look in the \xampp\apache\logs\error.log file for any clues.


All of the demos worked - all of them. Here is the code for the index.php page:
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;
?>
Something is wrong with the XAMPP installation :-(


and the error log:
Code: Select all
[Wed Dec 16 22:55:17 2009] [notice] Digest: generating secret for digest authentication ...
[Wed Dec 16 22:55:17 2009] [notice] Digest: done
[Wed Dec 16 22:55:19 2009] [notice] Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Wed Dec 16 22:55:19 2009] [notice] Server built: Jul 22 2009 11:35:54
[Wed Dec 16 22:55:19 2009] [notice] Parent: Created child process 2308
[Wed Dec 16 22:55:19 2009] [notice] Digest: generating secret for digest authentication ...
[Wed Dec 16 22:55:19 2009] [notice] Digest: done
[Wed Dec 16 22:55:20 2009] [notice] Child 2308: Child process is running
[Wed Dec 16 22:55:20 2009] [notice] Child 2308: Acquired the start mutex.
[Wed Dec 16 22:55:20 2009] [notice] Child 2308: Starting 150 worker threads.
[Wed Dec 16 22:55:20 2009] [notice] Child 2308: Starting thread to listen on port 443.
[Wed Dec 16 22:55:20 2009] [notice] Child 2308: Starting thread to listen on port 80.
[Wed Dec 16 23:21:46 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Wed Dec 16 23:21:46 2009] [notice] Child 2308: Exit event signaled. Child process is ending.
[Wed Dec 16 23:21:47 2009] [notice] Child 2308: Released the start mutex
[Wed Dec 16 23:21:48 2009] [notice] Child 2308: All worker threads have exited.
[Wed Dec 16 23:21:48 2009] [notice] Child 2308: Child process is exiting
[Wed Dec 16 23:21:48 2009] [notice] Parent: Child process exited successfully.
[Thu Dec 17 01:10:27 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 17 01:10:27 2009] [notice] Digest: done
[Thu Dec 17 01:10:29 2009] [notice] Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Thu Dec 17 01:10:29 2009] [notice] Server built: Jul 22 2009 11:35:54
[Thu Dec 17 01:10:29 2009] [notice] Parent: Created child process 3920
[Thu Dec 17 01:10:29 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 17 01:10:29 2009] [notice] Digest: done
[Thu Dec 17 01:10:30 2009] [notice] Child 3920: Child process is running
[Thu Dec 17 01:10:30 2009] [notice] Child 3920: Acquired the start mutex.
[Thu Dec 17 01:10:30 2009] [notice] Child 3920: Starting 150 worker threads.
[Thu Dec 17 01:10:30 2009] [notice] Child 3920: Starting thread to listen on port 443.
[Thu Dec 17 01:10:30 2009] [notice] Child 3920: Starting thread to listen on port 80.
[Thu Dec 17 01:11:13 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Thu Dec 17 01:11:13 2009] [notice] Child 3920: Exit event signaled. Child process is ending.
[Thu Dec 17 01:11:14 2009] [notice] Child 3920: Released the start mutex
[Thu Dec 17 01:11:15 2009] [notice] Child 3920: All worker threads have exited.
[Thu Dec 17 01:11:15 2009] [notice] Child 3920: Child process is exiting
[Thu Dec 17 01:11:15 2009] [notice] Parent: Child process exited successfully.
[Thu Dec 17 01:18:46 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 17 01:18:46 2009] [notice] Digest: done
[Thu Dec 17 01:18:46 2009] [notice] Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Thu Dec 17 01:18:46 2009] [notice] Server built: Jul 22 2009 11:35:54
[Thu Dec 17 01:18:46 2009] [notice] Parent: Created child process 1384
[Thu Dec 17 01:18:47 2009] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 17 01:18:47 2009] [notice] Digest: done
[Thu Dec 17 01:18:47 2009] [notice] Child 1384: Child process is running
[Thu Dec 17 01:18:47 2009] [notice] Child 1384: Acquired the start mutex.
[Thu Dec 17 01:18:47 2009] [notice] Child 1384: Starting 150 worker threads.
[Thu Dec 17 01:18:47 2009] [notice] Child 1384: Starting thread to listen on port 443.
[Thu Dec 17 01:18:47 2009] [notice] Child 1384: Starting thread to listen on port 80.
[Thu Dec 17 01:19:59 2009] [error] [client 127.0.0.1] File does not exist: D:/xampp/htdocs/xampp/index.html
[Thu Dec 17 01:19:59 2009] [error] [client 127.0.0.1] File does not exist: D:/xampp/htdocs/favicon.ico




Bill Smith wrote:But what you really want is to tell your browser to run the "index.php" program from the Apache server root directory (which is usually the htdocs folder.


Could you elaborate, please? This sounds like it may have the answer.
Kangaroo32
 
Posts: 7
Joined: 17. December 2009 04:38

Re: XAMPP has not installed PHP (I think?)

Postby Bill Smith » 18. December 2009 04:21

But what you really want is to tell your browser to run the "index.php" program from the Apache server root directory (which is usually the htdocs folder.


Keep in mind that I am a newbie - so the more experienced people should feel free to correct any mistakes that I make in my explanation.

When we develop pure HTML and Javascript code on our PC, we can double click on the file to have it execute/run and we immediately see the result open up in a browser window. We can't do that with PHP. PHP must be executed/run by being "called" by a browser. Not only that, but it must be called from a server that is able to run/interpret PHP.

When we install Apache, we have installed a server that is able to run/interpret PHP. BUT THAT IS ONLY PART OF THE SOLUTION. In order for us to execute the php file that we just finished creating, we have to place or store it on our PHP server. In Apache this usually means placing our php file within the HTDOCS file and then running from there by putting something like "localhost/ourdocument.php" in our browser window.

If I tell you about a great site, and give you the link, you would type that link into your browser window. Using a fake "WaffleMart" web site, I might say "type in and visit http://www.wafflemart. com/index.php" or just "http://www.wafflemart.com". Well, that is what you need to do. Only the site you're visiting is the one you are creating in the HTDOCS directory of your Apache server.

You can place your PHP files directly in the HTDOCS folder. But this causes problems if you're working on multiple sites. I find it a useful technique to create a different folder for each project. Let's say that I'm developing a web site for selling waffle irons. I usually start by creating a subfolder in the HTDOCS folder. I might use a name like "WaffleMart". I'll create my index.php file in that WaffleMart folder/directory. I can then test my code by opening up my browser and typing in "localhost/WaffleMart/index.php".
Bill Smith
 
Posts: 7
Joined: 09. December 2009 07:14

Re: XAMPP has not installed PHP (I think?)

Postby Kangaroo32 » 18. December 2009 05:07

If I have http://localhost/test.php, the php file does not work.
If I have http://localhost/testing/test.php, the php file DOES WORK.


Image


Thank you :!: :!: :D

I'm slightly curious as to WHY it works that way, but that doesn't matter so much to me. Thank you :)
Kangaroo32
 
Posts: 7
Joined: 17. December 2009 04:38


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 111 guests