Page 1 of 1

info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 16:34
by lyborko
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

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 16:57
by Altrea
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)

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 17:08
by lyborko
@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

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 17:22
by JonB
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

:)

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 17:29
by lyborko
@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(); ?>

????

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 17:40
by Caps
Seems to me that the php code should not be exposed if php server is operating.

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 18:01
by lyborko
@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/

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 18:16
by JonB
is the file 'info.php' in your htdocs folder???

:?:

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 18:27
by lyborko
yes.

where is defined to which folder actually "localhost" belongs?

Re: info.php does nothing (XAMPP 1.7.3)

PostPosted: 24. November 2010 18:41
by Altrea
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\