Stupid question for setting up my site for local testing

Hey guys, I’ve been doing basic web design (front end stuff) for a few years now. But I just got into a site that is programmed iwth PHP. I’ve FTP’ed all the site files down to my local machine and want to play around with the site a bit, but I can’t seem to get it to work. Here is what I did:

I installed XAMPP (on my Windows 7 machine). I verified all the services were running and was getting the XAMPP page when I went to http://localhost

I then copied all my site files into the /htdocs directory in the XAMPP folder that was created during the install. But I can’t seem to get to index.php.

What am I doing wrong? I’m very new to this so it is probably something really obvious… or can someone guide me in the right place to look?

BTW, the site that I FTP’d locally is

Does your site use the Database or it is just the static .html files? If it is using database then you must dump the database from the server and import those in your local mysql.

So all the website files are in htdocs not in another folder in htdocs.
You can view the default XAMPP index.html file

Basic things:
Try http://localhost/index.php as the html file will display first.
If your site is within another folder try http://localhost/folder/index.php

When I installed XAMPP I did not run it as a service but have to start it with a control panel and that works OK.

What happens if you create a php file in htdocs say server.php that contains:


If your using windows then why not use WAMP instead or XAMP?

No idea :slight_smile: I’m brand new to server-side coding… I was trying out XAMPP on a USB drive earlier for fun and that was working OK with pages from scratch. This is my first time trying to get the full site I’m involved with accessible. What are the benefits to WAMP?

I get a page PHP Version 5.3.1
and then a bunch of info … so it seems like it’s working in that case. but I can’t open index.php?..

Another thing I noticed:

 require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php'; 

Is in the PHP file that is in Index.html

I’ve noticed the actual index page for the site content is /app/webroot/index.php. It looks like this should reference it.

i’ve tried the URL http://localhost/app/webroot/index.php but also get nothing… I copied everything from the site so I’m basically stumped :stuck_out_tongue:

Is that it? i’m literally not seeing even my home page (index.php). Carrying over the files then from the site doesn’t automatically bring over your DB?

Carrying over the files then from the site doesn’t automatically bring over your DB?

Nope. I’m afraid not. if your remote server has access to phpMyAdmin (usually through cPanel, but not always), then you can log into your phpMyAdmin and export your database to a SQL file, and then use either mySQL from the command prompt, or phpMyAdmin on your local server (I think xampp has it(?)) to import the data. I can outline what I would have to do for my remote server (goDaddy), if this will help. And you can try http://localhost/phpMyAdmin/ to see if it’s installed.

[edit]I checked, and XAMPP has phpMyAdmin installed, if the default setup is used. That’s easy enough. :slight_smile:

Also, the XAMPP home page has a link to a FAQ for vista users, and this may also apply to Win7 users, as well:

»FAQ - Vista problems«

Yep, phpMyAdmin comes up with the admin page just fine…

It seems to me that for whatever reason the index.php that exists in my root directory isn’t working… I just FTP’ed down the entire site from the web server and didn’t touch anything else, so I guess I was just expecting it to function normally.

I noticed if I just go to localhost/shortsale in Firefox (the directory I created in HTdocs for my site a little later this afternoon, intsead of having it right in the root localhost directory) I get a index of the site files, but when I browse to public_html, nothing shows up. I can get to every other directory (mail, public_ftp, etc.) but not public_html. But I verified the files are in fact there in the c:/xampp/shortsale directory.

This seems odd :frowning: I tried putting the test PHP script from Rubble above as test.php in the /shortsale directory and when I type in localhost/shortsale/test.php it pulls up fine. WTH!

Here try this:

open C:\xampplite\apache\conf\httpd.conf

search for:

DocumentRoot “/xampplite/htdocs”
change it DocumentRoot “/xampplite/htdocs/shortsale”

search for :

<Directory “/xampplite/htdocs”>
change to <Directory “/xampplite/htdocs/shortsale”>

Assuming you have copied all your files to a folder named shortsale

Post us what happens

I saw your site then I am sure that it has used the database as well. So you must export the database from your server and import it to your local system. Have you already done this? If not do that right away and try. For importing database you need to create a database from XAMPP’s phpmyadmin and import it there. Only importing the database might not be enough too because you need to configure your site’s database configurations (there should be a config.php or such file) as well changing database name, database user and password.

XAMPP Stands for
X = Windows / Linux
A = Apache
M = Mysql
P = Perl

Just a little question : is this thing running??

I haven’t done anything other than FTP the entire site from where it was and dump it into a folder in HTDocs… haha. I’m giong to have to research how to import the DB, I’m not even sure in which directory the thing resides, what it looks like, or how many there may be. I’m very, very green when it comes to understanding PHP. I’m actually just starting reading the Sitepoint PHP book which I picked up during their Christmas sales :slight_smile:

Hope the following link will help you to dig in to the phpmyadmin and exporting data from it.

Also don’t forget that the name/pass for the database connection will be different.

It could be that your index.php is working fine but when it hits an error it may just stop the script, like if the script can’t connect to the database it will die and not reveal the error.

Also turn on error reporting in the php script, put this at the top of your script.

error_reporting(E_ERROR | E_WARNING | E_PARSE);