Page 1 of 1

testing php with xampp

PostPosted: 03. January 2009 01:01
by emyxd
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?

Re: testing php with xampp

PostPosted: 03. January 2009 01:05
by Wiedmann
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.

Re: testing php with xampp

PostPosted: 03. January 2009 01:09
by emyxd
^Thanks for the quick reply!
The file is saved as home.php in my htdocs folder
What would be the correct url?

Re: testing php with xampp

PostPosted: 03. January 2009 01:17
by Wiedmann
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".

Re: testing php with xampp

PostPosted: 03. January 2009 01:21
by emyxd
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

:(

Re: testing php with xampp

PostPosted: 03. January 2009 01:24
by Wiedmann
"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.

Re: testing php with xampp

PostPosted: 03. January 2009 01:38
by emyxd
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

Re: testing php with xampp

PostPosted: 03. January 2009 01:50
by Sharley
Check in your xampp\apache\conf\httpd.conf file for DocumentRoot location.

Re: testing php with xampp

PostPosted: 03. January 2009 01:54
by emyxd
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

Re: testing php with xampp

PostPosted: 03. January 2009 02:04
by Wiedmann
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".

Re: testing php with xampp

PostPosted: 03. January 2009 02:10
by emyxd
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');
}
?>

Re: testing php with xampp

PostPosted: 03. January 2009 02:12
by Wiedmann
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?

Re: testing php with xampp

PostPosted: 03. January 2009 02:21
by emyxd
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

Re: testing php with xampp

PostPosted: 03. January 2009 02:22
by Wiedmann
You can also access "http://localhost/xampp/phpinfo.php" in your browser and have a look for "DOCUMENT_ROOT".

:?:

Re: testing php with xampp

PostPosted: 03. January 2009 02:53
by emyxd
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>