how to run php script with xampp server

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

how to run php script with xampp server

Postby dutuktok » 26. November 2010 11:48

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
dutuktok
 
Posts: 4
Joined: 26. November 2010 11:19

Re: how to run php script with xampp server

Postby bradzo » 26. November 2010 12:18

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 .... :))
Run your own website from home using XAMPP. http://diyws.ath.cx
bradzo
 
Posts: 7
Joined: 08. August 2010 05:23
Location: Australia

Re: how to run php script with xampp server

Postby dutuktok » 26. November 2010 12:38

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
dutuktok
 
Posts: 4
Joined: 26. November 2010 11:19

Re: how to run php script with xampp server

Postby Nobbie » 26. November 2010 12:40

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?
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Re: how to run php script with xampp server

Postby dutuktok » 26. November 2010 13:11

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]
dutuktok
 
Posts: 4
Joined: 26. November 2010 11:19

Re: how to run php script with xampp server

Postby scampsall » 26. November 2010 15:06

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!
scampsall
 
Posts: 1
Joined: 26. November 2010 13:39

Re: how to run php script with xampp server

Postby JonB » 26. November 2010 17:51

@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
:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: how to run php script with xampp server

Postby dutuktok » 28. November 2010 07:10

thanks much for the help
my xampp is working :D
dutuktok
 
Posts: 4
Joined: 26. November 2010 11:19


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 100 guests

cron