testing php with xampp

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

testing php with xampp

Postby emyxd » 03. January 2009 01:01

hello

I am trying to test php with xampp, however, every time type "http://localhost/home.php" into the firefox browser, I get:

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
01/02/09 17:54:15
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8

My php file is saved inside the htdocs folder.

What do you think I am doing wrong?
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 01:05

Code: Select all
Error 404 - Object not found!

What do you think I am doing wrong?

You are using a wrong uri for the file you want request, and/or the file is not saved at the correct location.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 01:09

^Thanks for the quick reply!
The file is saved as home.php in my htdocs folder
What would be the correct url?
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 01:17

The file is saved as home.php in my htdocs folder
What would be the correct url?

"http://localhost/home.php", if you mean the XAMPP/Apache DocumentRoot with "my htdocs".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 01:21

Wiedmann wrote:
The file is saved as home.php in my htdocs folder
What would be the correct url?

"http://localhost/home.php", if you mean the XAMPP/Apache DocumentRoot with "my htdocs".


I still get :

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
01/02/09 18:20:31
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8

:(
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 01:24

"http://localhost/home.php", if you mean the XAMPP/Apache DocumentRoot with "my htdocs".

I still get: "Object not found!"

Then the file "home.php" is not in your DocumentRoot.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 01:38

Wiedmann wrote:
"http://localhost/home.php", if you mean the XAMPP/Apache DocumentRoot with "my htdocs".

I still get: "Object not found!"

Then the file "home.php" is not in your DocumentRoot.

Hmmm, document root is supposed to be xampp->htdocs folder right?

Are there other ways to view php files?

I am so lost T___T
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Sharley » 03. January 2009 01:50

Check in your xampp\apache\conf\httpd.conf file for DocumentRoot location.
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: testing php with xampp

Postby emyxd » 03. January 2009 01:54

Sharley wrote:Check in your xampp\apache\conf\httpd.conf file for DocumentRoot location.

Woww, that's a lot to read, but I found

ServerRoot "C:/Users/Emily/Desktop/xampp/apache"

Is that supposed to be in the body link for displaying php files? O_o
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 02:04

Woww, that's a lot to read, but I found
ServerRoot "C:/Users/Emily/Desktop/xampp/apache"

ServerRoot is not DocumentRoot. Search the file more carefully.

You can also access "http://localhost/xampp/phpinfo.php" in your browser and have a look for "DOCUMENT_ROOT".


Well, with this ServerRoot your DocumentRoot should be "C:/Users/Emily/Desktop/xampp/htdocs". That's the place for your PHP files.

And a file "home.php" in this directory is called in your browser with "http://localhost/home.php".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 02:10

Wiedmann wrote:
Woww, that's a lot to read, but I found
ServerRoot "C:/Users/Emily/Desktop/xampp/apache"

ServerRoot is not DocumentRoot. Search the file more carefully.

You can also access "http://localhost/xampp/phpinfo.php" in your browser and have a look for "DOCUMENT_ROOT".


Well, with this ServerRoot your DocumentRoot should be "C:/Users/Emily/Desktop/xampp/htdocs". That's the place for your PHP files.

And a file "home.php" in this directory is called in your browser with "http://localhost/home.php".


Ohhh, it was more towards the bottom ^^;

DocumentRoot "C:/Users/Emily/Desktop/xampp/htdocs"

If the link is right...the file is saved in the right folder...what is the problem?


this is what inside of home file:


<?php
if($indexCheck == "yes")
{
?>
Content Goes here!
</div>
</div>
<?php
}
else
{
require('error.php');
error('505');
}
?>
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 02:12

If the link is right...the file is saved in the right folder...what is the problem?

Open a command prompt (cmd.exe) and execute this command:
Code: Select all
dir C:\Users\Emily\Desktop\xampp\htdocs\home.php


What's the output?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 02:21

Wiedmann wrote:
If the link is right...the file is saved in the right folder...what is the problem?

Open a command prompt (cmd.exe) and execute this command:
Code: Select all
dir C:\Users\Emily\Desktop\xampp\htdocs\home.php


What's the output?

Hope I did this right:

06/05/2008 10:25 AM 145 home.php
1 file(s) 145 bytes
0 Dir(s) 80,434,216,960 bytes free
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59

Re: testing php with xampp

Postby Wiedmann » 03. January 2009 02:22

You can also access "http://localhost/xampp/phpinfo.php" in your browser and have a look for "DOCUMENT_ROOT".

:?:
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: testing php with xampp

Postby emyxd » 03. January 2009 02:53

Wiedmann wrote:
You can also access "http://localhost/xampp/phpinfo.php" in your browser and have a look for "DOCUMENT_ROOT".

:?:

I am pretty sure my doc root is the xampp htdocs
Something is wrong though, just can't figure out what! ><

I am using firefox browser btw...could that affect this?

<edit>

NEVERMIND!!!!!!!!!!!!!
Problem solved ;)

thanks so much for your patience with me dude!!!

</edit>
emyxd
 
Posts: 9
Joined: 03. January 2009 00:59


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 141 guests