how do I set up PHP, do I have to do that?

arturoca

New Member
Messages
2
Reaction score
0
Points
0
hello, I joined today;
I'm not new with PHP or MYSQL, but this the first time that I have a web hosting.
I meant, I have configured a local server in my computer with PHP5 and apache, but I'm new in "real" web hosting. Anyway, when I upload my first index.html with the text

<p> hello </p>

it renders "hello" in my navigator as expected, no problem with that.
but when I put

<p> hello </p>
<?php
echo "I'm a php script";
?>

it just renders the "hello" in the <p> tags. As if PHP were not installed;
SO I guess I have to configure something?

thanks in advance, have a super day.
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
The file has to have .php as an extension for it to be parsed as PHP

Not sure if there is a way you can use .htaccess to force the server to parse .html extension files as PHP.
 

arturoca

New Member
Messages
2
Reaction score
0
Points
0
thank you, I swear I've always put *.html and in worked
x) anyway, I will close this thread if I find how. lol
 

Mr. DOS

Member
Messages
230
Reaction score
5
Points
18
Your local webserver was probably configured to parse .htm and .html files with PHP as well as .php files; most "production" servers don't do this for performance reasons: assuming .htm and .html files are purely static or at least, only have SSI's, saves a lot of CPU cycles.

--- Mr. DOS
 

ah-blabla

New Member
Messages
375
Reaction score
7
Points
0
Not sure if there is a way you can use .htaccess to force the server to parse .html extension files as PHP.
Unfortunately you can't on this server - you can however use SSI in html, which can also be used to run php scripts.
 
Top