visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: PHP RedHat Linux 8 not executing...


By: PHP newbee U.S.A.  Date: 14/12/2002 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
I'm trying the following test script as test.html in my
/var/www/html directory:

<html>
<body>
Today's Date is
<? echo date("Ymd"); ?>
</body>
</html>

I see the text but the php part does not execute,
I also tried to insert phpinfo(); instead of the date
and it does not execute either.

When I save a file as test.php and put in phpinfo();
it executes alright.

What am I doing wrong?
By: TheFalklands Date: 14/12/2002 12:09:00 English  Type : Comment
The server does not recognize the serverside tags in a html page with .htm or .html . When u use ".php" the server then executes php script. That's y u r not getting the date displayed.
By: PHP newbee Date: 14/12/2002 12:33:00 English  Type : Comment
But how do I get the server to recognize php within a html document?
By: VGR Date: 14/12/2002 14:43:00 English  Type : Answer
VERY EASY

In the httpd.conf file, add .htm .html .phtml in two line :

AddType application/x-httpd-php .php .htm .html .phtml

you may also check that this line exists :
DirectoryIndex index.php index.php3 index.phtml index.html index.htm index.shtml index.cgi

regards

Do register to be able to answer

EContact
browser fav
page generated in 335.016010 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page