How to get php pages to display? Please help.

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

How to get php pages to display? Please help.

Postby Cocori » 27. September 2012 00:05

Hi.
Firstly, I'm a complete novice.
My website and its database perform perfectly when hosted online by my webhost, so I know everything works. I have currently removed the site from my host's server and need to do some work on it offline, on my own pc (running Windows Vista Home Premium). It is NOT a Wordpress site.
I have installed XAMPP 1.8.0, put all my site files in the xampp htdocs folder, created the database and installed the .sql file, and the database works fine, I can access it via phpMyAdmin. Apache and MySQL start without problem. I have not changed any xampp settings or anything.
However, I need to know how to get my php files to display properly as web pages in a browser, just as they did when it was uploaded and online. If I go to file:///C:/xampp/htdocs/index.php all that shows in the browser is the php code on my index.php file. I also tried file:///C:/xampp/htdocs/index.php, with exactly the same result. The index page (nor any other of the php pages) is not assembled. It is not just that images don't load (as I see is a problem others have had), nothing is being generated, I just see all the code on the php file.

I created a test.php file, with an html line and a php line and only the html line displays when it is opened at file:///C:/xampp/htdocs/test1.php.
(the php code does not show on that test file, unlike the way it does on the index.php file).

Someone said I would need to change the database/config.php file to align to the sql so localhost is where your connecting too, so I changed my site's config.php file to
Code: Select all
$dbHost = 'localhost';
$dbUser = 'root';
$dbPass = '';
$dbName = 'esite';

esite being the name of the database. I do not know if this is what they meant and have not been able to find out from them since. Perhaps I have gone wrong here.

What am I overlooking? Probably something very basic but I am a complete novice, so haven't a clue. I know little about php or MySQL and even less about xampp. When my site was originally created, some years ago, I could access it all offline using xampp but can't remember how and I had some help back then that is not available now.

Can anyone tell me, in very simple terms, what I should be doing to make the site's php pages display properly, please? You will make a despairing woman very relieved and eternally grateful.

Regards,
Cocori
User avatar
Cocori
 
Posts: 1
Joined: 22. September 2012 02:03
XAMPP Version: 5.6.3
Operating System: Windows Vista Home Premium

Re: How to get php pages to display? Please help.

Postby Altrea » 27. September 2012 08:12

Hi Cocori,

Cocori wrote:Can anyone tell me, in very simple terms, what I should be doing to make the site's php pages display properly, please?

This way please: viewtopic.php?f=16&t=50681&p=195077#p195077

best wishes,
Altrea
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: 6828
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: How to get php pages to display? Please help.

Postby hdalive » 27. September 2012 09:24

You must use localhost in address line not the windows url. The above link will provide more info.


Either way here an example

Code: Select all
Example: C:/xampp/htdocs/index.php

http://localhost/index.php
hdalive
 
Posts: 4
Joined: 25. September 2012 12:02
XAMPP Version: 5.6.3
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: JJ_Tagy and 60 guests