Xampp Index.php File

Active3 years, 11 months ago

If you have more than one (say index.html, index.php), required file will be chosen based on the order defined in your web server’s configuration settings. Locations of Configuration Files Based on your requirements, sometimes you would need to change default settings of your web and database servers.

I have a problem running PHP in XAMPP 1.7.7 for windows. I've installed XAMPP in a local server with IIS (changed the port to 81 in httpd.conf as well as other configuration) so far it works and I could connect to the xampp/index.php but coulnd't run any .php files in my htdocs (shows blank except for the html part). It works in my local (also have an IIS installed) but couldn't make it work in a server.

Any help would be much appreciated.

LoupiLoupi
5824 gold badges21 silver badges39 bronze badges

6 Answers

If I got your question correctly, I think I had the same problem accessing a php file in XAMPP. I have been online for several hours searching forums and Google for the answer, not until I found the simple solution.

I was accessing the PHP file as a file on c drive (eg. C:xamphtdocsdata.php or file:///c:/xamp/htdocs/data.php) instead of as a webpage (ie //localhost/data.php).

I hope this will be helpful to you as well.

Echilon
5,99627 gold badges115 silver badges198 bronze badges
user28864user28864

Create a folder in htdocs like 'test'.

Then in test put index.php with a simple Echo 'Hello';

Then on your browser (make sure apache + mysql are running in control panel).

Visit this in your browser:

If your trying to connect via your IP then your router must be stopping it so you have to sort the settings out. I don't know your router make/model you better off asking their support forums.

Personally i stuck with port 80. 80 doesn't work in windows 7 because a service is using it. How ever, its a simple fix, just go to 'Services' and disable 'World Wide Web Publishing Service'. Then port 80 is free to use on localhost. (Don't worry your internet will work just fine disabling that service). It'll auto re-enable on next boot so you have to remember that.

SirRunSir
4,7939 gold badges59 silver badges122 bronze badges

Make sure you are not running it as a file from your drive,(my example):

but rather as a webpage, which means the address must start with 'localhost'

Xampp Server

If you are using a different port (not the standard 80, but for example 8080), then:

AndrejsAndrejs
5,9082 gold badges32 silver badges38 bronze badges

I had the same problem.For me worked to change <? ... ?> to <?PHP ... ?> in the script.Maybe new wersion of PHP doesn't support the first definition of PHP script.

user4313155

Use this: //localhost/data.phpInstead of this: C:xamphtdocsdata.php

user805776user805776

Simply..

  1. Save the file/code first(EVERYTIME),'command + s' everytime.

  2. Refresh the browser.

good to go

Neha Shukla
2,6434 gold badges30 silver badges64 bronze badges
mark anthony tryton novillamark anthony tryton novilla

protected by CommunityJan 6 '16 at 19:27

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged phpxampp or ask your own question.

Active5 years, 8 months ago

I apologize in advance if this issue has been posted before. My problem is that my programmer had to bail on my project due to personal reasons and left me alone with a 95% finished site. I have some basic experience with ASP classic but PHP is fairly new to me.

Xampp Index.php File

FireFTP scr_shot: https://www.dropbox.com/s/9lws1u0sl8k93rg/fireftp_scr_shot.jpg

To shorten it up; (with Xampp installed) I have downloaded my site to the hard-drive and is now trying to get it work on 'localhost'. Immediately I sense the absence of an index-file.

Do I need to make one myself for the use in localhost? In that case, what am I looking for?

Thank you in advance.

badprimerbadprimer

Xampp Index.php File Download

2 Answers

First if you want to make an index-file of your current website, you have to put all your pages in a folder in

xampp/htdocs/

e.g

C:Xampphtdocsmywebsite

then after you make a directory just visit the url like this:

localhost/mywebsite

, remember to put an index file inside the mywebsite folder.

Cedric MarianoCedric Mariano

It turned out that there was a MYSQL-database behind the site which I had no idea about or any knowledge of how to get around.

I had the database taken off and written the code into the site-files.

Afterwards everything worked as laid out above comments.

badprimerbadprimer

Not the answer you're looking for? Browse other questions tagged phpxampplocalhost or ask your own question.