+ 6
How should i run .php files in Google Chrome??
After writing all the php codes when i try to open the file which is save as .php all the codes get displayed on my browser instead of displaying the codes which i wrote in echo part. I need a help.
18 Respostas
+ 11
open xampp, htdocs folder and create new folder inside the htdocs folder and give it an name " let's call it name".
now put the .php files you create in this folder "example index.php ". it's very important to run xampp,
after running xampp open browser and type
http://localhost/name/index.php
now you should see the content of the index file
+ 5
You'll need a localhost server to run PHP on your PC
try xamp
after installing and configuring make sure you start the Apache server and the php file must be in the htdoc directory in the xamp folder
go to Chrome and type localhost/your PHP file
+ 4
index.php
that's odd. is the page blank or what does it show? maybe you can post your code in code playground.
+ 2
did you use <?php //code ?> to let the php interpreter know that it is php code?
+ 2
How do i run a php code on chrome
+ 1
save your files in root folder, .php extension. turn on your local server..type localhost in address bar, if its not working type localhost:8080, localhost:3036 etc. let us know what exactly you're facing
+ 1
you need a localhost server to run PHP on your PC
try wamp if using Mac try Mamp or Lamp for Linux
after installing and configuring
go to Chrome and type localhost/your PHP script
+ 1
you must install a server apache in your machine, because php is a server side programming language š
0
i have already install xampp and started apache and mysql but still its not working
0
where did you save the files?
0
xampp/htdocs/dashboard/
0
okay and you open them in chrome like http://localhost/dashboard ?
do you see the XAMPP landing page when you just enter localhost?
0
yes i can... but i have change the index.html file in the dashboard with my index file
0
I think you have something misconfigured in XAMPP
0
is apache running ? when you've install it did you choose a different port than the default port which is 8080 ?
0
get wampserver then save everything in the www file. run it all from that. id look up a tutorial on the wampserver tho. been a minuets since I used it :/
0
you need server to run php. either run in local server or host it.
for local server you can use xampp, for other platforms similar local server are available. install and run your php.
0
don't open the files from folders directly, instead, COPY this link to chrome
localhost:(your port number)\dashboard\