PHP not running

0 Gary Miller · September 2, 2014
I am very new to programming. I downloaded xampp and tried to run php. At first i didn't save the files in htdocs, then I realized you have to. Once I did that i had the same problem. Whenever I launch in chrome or other browsers the code doesn't run. It is just displayed like it would be in a text editor. Please help. I'm sure it is a simple rookie mistake. 

Post a Reply

Replies

Oldest  Newest  Rating
+2 Franz Schmidt · September 2, 2014
Did you activate Apache on XAMPP. This is needed to run php code.

/images/forum/upload/2014-09-02/5d38b3b1e051305244cea23e78cb2dca.PNG
+1 Ibrahim Tuzlak · September 2, 2014

It is just displayed like it would be in a text editor.


Are you sure you are entering the following URL:

localhost/TheFileName.php

EDIT: As far as I know, the PHP file would be shows as text if it is opened in a form of
C:\wamp\htdocs\file.php
and not localhost, as c:\... is not the right way to run it.
+1 Otto Fekonja · September 2, 2014
how do you open files/code? do you click on file? if you do, and want to lunch in chrome, it must be saved in .html format.

but if you using wamp/xamp you must type localhost in url bar of your browser, then navigate to you source folder where your project is smth like this..

localhost/my_project/index.php
0 Gary Miller · September 3, 2014
Thank you guys! I wasn't opening the file right. Once i typed in localhost/filename/filename it worked! So thankful for Buckysroom
  • 1

PHP

107,173 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators