info.php does nothing (XAMPP 1.7.3)

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

info.php does nothing (XAMPP 1.7.3)

Postby lyborko » 24. November 2010 16:34

Hi,

it is perhaps very trivial problem. I installed XAMPP 1.7.3 . In the Control Panel App I see, that Apache and MySQL (which was already installed a month ago) is running . I am a very rookie in PHP, so I tried the simplest way to find out, if PHP engine is running. So I created file in htdocs directory> info.php, in which was written:
<?php phpinfo(); ?>

I saved it, right clicked, commanded: open in Opera webbrowser.

All I see is text : <?php phpinfo(); ?>

Just like plain text file.

What is wrong?

thanx

Lyborko
lyborko
 
Posts: 5
Joined: 24. November 2010 16:24

Re: info.php does nothing (XAMPP 1.7.3)

Postby Altrea » 24. November 2010 16:57

lyborko wrote:right clicked, commanded: open in Opera webbrowser.


This can't work! php is a serverside programming language. Your Browser can't know, that you are running a webserver and that he must send the file through the php parser first.
You must request the file like it were a Homepage.

http://IP/folder/filename.xyz

in your case:
http://localhost/info.php
(localhost is an Alias for 127.0.0.1 which is every PCs own IP-Adress Loopback)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: info.php does nothing (XAMPP 1.7.3)

Postby lyborko » 24. November 2010 17:08

@altrea

info.php is in the following folders:
C:\info.php
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\info.php

it's the same. Then I put : http://localhost/info.php in adressbar of Opera

This appeared :

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/24/2010 5:00:46 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

Thanx for reply
lyborko
 
Posts: 5
Joined: 24. November 2010 16:24

Re: info.php does nothing (XAMPP 1.7.3)

Postby JonB » 24. November 2010 17:22

C:\info.php
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\info.php


Do you have two Apache installations or something? or are you copying from some web page - Neither of thse addresses have ANYTHING to do with an XAMPP installation -

its really simple -

XAMPP has a built-in phpinfo.php

go to this page -

http://localhost/xampp/

click on phpinfo() in the left column ~tada~ PHPINFO!!!

There's lot of other utilities on that page as well

BTW - you should also go to the XAMPP FAQ page and use 'the practice section' - you will learn a lot
http://www.apachefriends.org/en/xampp-windows.html

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: info.php does nothing (XAMPP 1.7.3)

Postby lyborko » 24. November 2010 17:29

@JonB

Thanx.
yes, clicking on http://localhost/xampp/ works fine....

this file info.php is pure example,just for demonstration, that php and apache work. I created it myself.

so what is wrong with mine primitive "info.php" in which is single line of code: <?php phpinfo(); ?>

????
lyborko
 
Posts: 5
Joined: 24. November 2010 16:24

Re: info.php does nothing (XAMPP 1.7.3)

Postby Caps » 24. November 2010 17:40

Seems to me that the php code should not be exposed if php server is operating.
Caps
 
Posts: 18
Joined: 19. November 2010 19:21

Re: info.php does nothing (XAMPP 1.7.3)

Postby lyborko » 24. November 2010 18:01

@wole

info.php is really info.php NOT info.php.txt

actually php is running somehow, cause I installed joomla on local harddrive and it is working (so php engine is alive)

I feel like real dummie... maybe I am... the same feeling I had, when I tried to compile c# files with native compilator using only command line. No way to do it like it was written in the cook book... nasty hell....

OK guys so can anybody throw a ray of light into this funny thing? :-}
/I confess I know nothing about apache and PHP/
lyborko
 
Posts: 5
Joined: 24. November 2010 16:24

Re: info.php does nothing (XAMPP 1.7.3)

Postby JonB » 24. November 2010 18:16

is the file 'info.php' in your htdocs folder???

:?:
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: info.php does nothing (XAMPP 1.7.3)

Postby lyborko » 24. November 2010 18:27

yes.

where is defined to which folder actually "localhost" belongs?
lyborko
 
Posts: 5
Joined: 24. November 2010 16:24

Re: info.php does nothing (XAMPP 1.7.3)

Postby Altrea » 24. November 2010 18:41

directly it is defined nowhere.

It belongs to your Webserver configuration, so indirectly it is defined there.
(indirectly because it is not defined for localhost, but for requests the webserver receives)
Inside your XAMPP Installation folder is everything you need:
- your Servers (Webserver, Databaseserver, FTRP-Server, etc.)
- your Databases
- your Application files (should be saved there).

By default your DocumentRoot Folder for your XAMPP Apache is \xampp_installation_dir\htdocs\
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8299
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: JJ_Tagy and 68 guests