Languages :: PHP :: PHP RedHat Linux 8 not executing... |
|||
| By: PHP newbee |
Date: 14/12/2002 00:00:00 |
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 | 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 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








