On Thu, Feb 04, 2010 at 11:19:21PM +0000, James Bensley wrote:
Well if you want to put some PHP code in to a page you open the php tag:
<?php MY_PHP_CODE_HERE then close the php tag like so: ?>
... and make the page URL end with .php.
When a client browses a page on your web server with these tags in the page the web server see's the tags it processes the code before serving the client the page. This is not a native language of a web server or browser. To have PHP pages hosted on your server you must have the PHP module installed. For Apache you need to download and install the php module and then add it into the httpd.conf file. (These days PHP is often bundles in just not enabled, although that wouldn;t be the case if you downloaded the Apache source and built from scratch). For windows you would need to download PHP, install it somewhere then add it as an extension in you IIS settings and enabled it for processing pages ending in .php.
Another example would be that Microsoft IIS supports ASP which is again a server side scripting language that only runs on the IIS web service if you enabled the ASP extensions.
As far as I am aware you can't have python or perl as a server side scripting language. You may want to look at CGI/Perl scripts however for processing parsed data. You can use Perl in this sense. For example you can have a HTML form submit its data to a Perl script on the server which can then process the parsed information as required (for example, saving it to a file).
So back to the original question, PHP is an extension of your web servers native functionality.
But doesn't really seem to be documented anywhere, the <?php bit that is, everyone just uses it and it works.