PHP not working

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

PHP not working

Postby thehodapp » 22. October 2009 05:00

I installed xampplite successfully on windows xp and everything seems to work. I am entirely offline--no internet. The xampp homepage comes up when I go to localhost just as it is supposed to. However when I put .php files into htdocs and try to open them in a browser, the php code does not work. It doesn't compile at all.

What is my problem?
thehodapp
 
Posts: 5
Joined: 22. October 2009 04:55

Re: PHP not working

Postby Izzy » 22. October 2009 05:22

So http://localhost goes to the XAMPP Welcome page and you tested the demos on that page's menu - they are mostly php coded files?

What files did you put in the htdocs folder and after testing XAMPP above you deleted the index.php and the index.html that belong to XAMPP before adding your own files?

What did you type in the browser to access your php files?

BTW after deleting the XAMPP index files in the htdocs folder you can still access the XAMPP Welcome Page by typing in your browser:
http://localhost/xampp/
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP not working

Postby thehodapp » 22. October 2009 18:27

I didn't delete the index.php or the index.html files. I created a new folder inside of http://localhost/xampp/htdocs called mywebsite and wrote a .php file and clicked on it from windows explorer but the code does not work. I know that I wrote it correctly.
thehodapp
 
Posts: 5
Joined: 22. October 2009 04:55

Re: PHP not working

Postby Wiedmann » 22. October 2009 19:29

and clicked on it from windows explorer but the code does not work.

You can't click on a *.php file. You must open it through the server with "http://".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP not working

Postby Izzy » 22. October 2009 23:12

thehodapp wrote:I created a new folder...called mywebsite and wrote a .php file and clicked on it from windows explorer but the code does not work. I know that I wrote it correctly.
You can click on a *.php file if you have associated the php file extension with your php code editor or any text editor like notepad for example.

To see how the php code works after editing or creating the code then the Apache server has to parse the code.

So in your case if you type in your browser http://localhost/mywebsite/myphpfile.php then it will show you the results of your php creation.

Good luck.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 195 guests