Page 1 of 1

how to run php script with xampp server

PostPosted: 26. November 2010 11:48
by dutuktok
this is the message i got after loading the http://localhost.filename.php
the file requested by the client was not found. pls help me guys what to do


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
11/26/2010 6:00:25 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

Re: how to run php script with xampp server

PostPosted: 26. November 2010 12:18
by bradzo
Are you sure your URL is correct?

http://localhost.filename.php

doesn't look right to me :)

http://localhost

really points to the htdocs location of your xampp installation.

Lets assume that's

c:\xampp\htdocs

then your php file called filename.php needs to be in c:\xampp\htdocs

and you need to put in your browser address bar:\

http://localhost/filename.php

That should do something (as long as the php file is called filename.php .... :))

Re: how to run php script with xampp server

PostPosted: 26. November 2010 12:38
by dutuktok
bradzo wrote:Are you sure your URL is correct?

http://localhost.filename.php

doesn't look right to me :)

http://localhost

really points to the htdocs location of your xampp installation.

Lets assume that's

c:\xampp\htdocs

then your php file called filename.php needs to be in c:\xampp\htdocs

and you need to put in your browser address bar:\

http://localhost/filename.php

That should do something (as long as the php file is called filename.php .... :))


i mean "http://localhost/filename.php"
i did the same
points to the htdocs location of xampp installation.
i saved my php file at the c:\xampp\htdocs
and it doesnt really work

Re: how to run php script with xampp server

PostPosted: 26. November 2010 12:40
by Nobbie
dutuktok wrote:i saved my php file at the c:\xampp\htdocs


How did you create/save your filename.php? Which editor did you use?

Re: how to run php script with xampp server

PostPosted: 26. November 2010 13:11
by dutuktok
Nobbie wrote:
dutuktok wrote:i saved my php file at the c:\xampp\htdocs


How did you create/save your filename.php? Which editor did you use?


im looking to the internet about php tutorial and i saw this one,
apache server is already running

<html>
<head>
<title>My First PHP Page</title>
</head>
</body>
<?php
print ('Hello. How do you find PHP so far?');
?>
</body>
</html>

i save my file at C:\xampp\htdocs
i used notepad++ (we tried to use at school and it works)
[thank you for understanding]

Re: how to run php script with xampp server

PostPosted: 26. November 2010 15:06
by scampsall
Hi, I just installed Xampp and had some similar issues which were proving very frustrating!!

Are you sure Apache is running? On the Xampp control panel, when you check the 'Svc' box next to Apache and press 'Start', to the right of where it says Apache should display a green strip that says 'Running'. Just because the log window says 'Apache service started' doesn't mean it's running - this is what was happening to me!

Check out this post: http://www.netshinesoftware.com/compone ... AMPP.html/

It has a couple of clearly pretty successful suggestions for most people and they are all to do with other programmes and services using Port 80 and therefore blocking Apache (Skype seems to be the most common culprit). However, for me the post wasn't useful, but the additional comments afterwards. This allowed me to identify that a Windows Service - World Wide Web Publisher - was the guilty party and after turning that off Apache and Xampp worked first time.

I'm not very technical so am unlikely to be able to help further, but let us know how you get on - maybe someone else can move things on if you're still stuck after reading that?
Good Luck!

Re: how to run php script with xampp server

PostPosted: 26. November 2010 17:51
by JonB
@scampsall

this message is a pretty good indicator that Apache is running:
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
11/26/2010 6:00:25 PM
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1


@ dutuktok

The best test for PHP is simply to go to the XAMPP page - http://localhost/xampp

it it works - PHP and Apache are working

That usually makes basic PHP debugging a matter of:

Short Open Tags - usually a blank page or 'text containing code'. - not the case here

404 errors - Either the page is NOT really named what you thought, or was placed in the wrong place.

If the XAMMP Page worts, since the PHP syntax is OK - the problem virtually has to be with the filename or its location.

A good way to check is to step arounf the Windows Explorer (that can hide file extensions). Open a Command Prompt at c:\xampp\htdocs and take a directory of the folder - see what's in the folder

Good Luck
:)

Re: how to run php script with xampp server

PostPosted: 28. November 2010 07:10
by dutuktok
thanks much for the help
my xampp is working :D