Hi group, I have an HTML page that I want to run some PHP code. I found several "How tos" about this but I can't get it to work. The code is very simple: Code: cat test.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Test</title> <meta content="william estrada" name="author"> </head> <body style="background-color: rgb(204, 204, 204); color: windowtext;" link="#0000ee" vlink="#551a8b" alink="#ee0000"> <center> <?php echo "Last modified: " . date ("F d Y", getlastmod()); ?> </body> </html> Code (markup): My php.conf look like this: cat /etc/httpd/conf.d/php.conf # # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # <IfModule prefork.c> LoadModule php5_module modules/libphp5.so </IfModule> <IfModule worker.c> LoadModule php5_module modules/libphp5-zts.so </IfModule> # # Cause the PHP interpreter to handle files with a .php extension. # AddHandler php5-script .php AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.php # # Uncomment the following line to allow PHP to pretty-print .phps # files as PHP source code: # AddType application/x-httpd-php-source .phps Code (markup): Any .php file works OK but not any embedded php code. What am I missing?? Thanks for your time. __________________ William Estrada MrUmunhum@popdial.com Mt-Umunhum-Wireless.net ( http://64.124.13.3 )
Not true. I fixed it by changing my conf file: This AddType application/x-httpd-php .php to AddType application/x-httpd-php .php .html Code (markup): This should be a default??
Wouldn't recommend doing it in the main config file as that'll mean it'll run all .html pages through PHP which won't add a lot of load to the server, but will add load that you probably don't need to. Maybe the better idea would be to add a line to .htaccess AddType application/x-httpd-php .html ...so it'll only apply to the .html files in the web site in question. Trev