Re: cannot run php within html

From: Date: Fri, 12 Oct 2001 08:22:47 +0000
Subject: Re: cannot run php within html
Groups: php.install 
Request: Send a blank email to php-install+get-4610@lists.php.net to get a copy of this message
Hi Roger, "Roger Pang" <roger.pang@samsonpaper.com.hk> wrote in message news:20011012062505.95073.qmail@pb1.pair.com... > I have written the following html called "test.html" in /var/www/html > directory : > <html> > <body> > <?php > phpinfo() > ?> > </body> > </html> > > When I access this html with a browser, nothing displayed. However, when I > renamed it to "test.php", it works. It should be named with the .php extension. This is so the web server knows to hand the file to PHP for processing and then returns the results to your browser. You can modify your setup (httpd.conf) so php parses .html files aswell but there is no real need. If you do need this then find the folowing line in <apachedir>/conf/httpd.conf ...... AddType application/x-httpd-php .php ...... and then add which ever extensions you wish to be processed by PHP i.e. AddType application/x-httpd-php .php .html Remember to restart Apache after any changes. > > Anything wrong ? I am running Red Hat 7.1 and chosen to install everything. > No change on any config files relating to PHP and Apache. Nothing wrong so enjoy ;o) - Paul - > > > > > > -- > PHP Install Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-install-unsubscribe@lists.php.net > For additional commands, e-mail: php-install-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.install (#4610) next »