Problem with moving a site from remote server to localhost

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
willowone
Forum Newbie
Posts: 2
Joined: Tue Jul 20, 2010 6:24 am

Problem with moving a site from remote server to localhost

Post by willowone »

Hey guys,

i want to run a site that runs in a remote server to my server (apache).I extracted the database and took all the php files,but of course it doesnt run.It does not show an error in any line,it just shows the php code between html.I can see that it starts showing php from this line of code:

Code: Select all

if ($thecandidate->get("id") == 0)
so the first line when i open it in the browser is get("id") == 0) and then it cotinues with the rest of the code.

As this is the first time i am doing something like this i dont know where to start looking for the problem!Was the whole procedure of copy/paste the files wrong?Any other suggestions? Thanks in advance!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Problem with moving a site from remote server to localho

Post by John Cartwright »

A few quick questions you need to ask yourself:

Is PHP installed on my local server?
Are short tags being used in my scripts? --- <? vs <?php
Are short tags disabled on my local server?
Do the files you copied the code to end in .php
- or -
Is my server configured to treat the extension I've used as PHP.
Post Reply