[FX.php List] A question about PHP in pages

Andrew Denman adenman at tmea.org
Wed Dec 20 10:58:11 MST 2006


For completeness' sake, this is possible on Windows with IIS as well.  You
will need administrator access to the server to do this.

Website Properties > Home Directory > Configuration...
On the "Mappings" tab, you can see the current extension mappings and add
new ones.  You can find the php extension in the list to determine what to
specify for your new extensions (it will be different between the ISAPI and
CGI versions of PHP).

Andrew Denman

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Roger Price
Sent: Wednesday, December 20, 2006 3:15 AM
To: FX.php Discussion List
Subject: Re: [FX.php List] A question about PHP in pages

Bob

What Jason has said is correct. However it does not actually answer your
original question!.

I do not have authority to edit the Apache 'httpd.conf' on the web server I
use but the necessary configuration can be included in a file called
'.htaccess' - yes that's right it looks like an extension without a file
name.

AddType application/x-httpd-php .php .phtml .html .shtml  (notice the
additional file extensions)
AddType application/x-httpd-php-source .phps
DirectoryIndex  index.html index.shtml index.php  (notice the list of
default pages - which are processed in order)

Create a file called '.htaccess' with the above lines and copy it to your
web 'root' folder.

Apache will now read this for any request and run pages with the extensions
.php .phtml .html .shtml through the PHP parser. You can remove those
extension that you do not want.

The reason for having specific extentions is to limit the load on the
webserver. If you have a page that does not contain PHP there is no point
parsing it! However if you have created a PHP site then most if not all
pages will probably use it in some form or another. Having all pages with a
'.html' extension does hide the technology that you are using because there
is no evitence in the served page that PHP was involved.

HTH

Roger


----- Original Message ----- 
From: "jason f. boldt" <jason_fb at beezwax.net>
To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
Sent: Wednesday, December 20, 2006 8:26 AM
Subject: Re: [FX.php List] A question about PHP in pages


> Bob,
> Here's a snippet from a standard Apache configuration file:
>
> <IfModule mod_php4.c>
>      # If php is turned on, we repsect .php and .phps files.
>      AddType application/x-httpd-php .php
>      AddType application/x-httpd-php-source .phps
>
>      # Since most users will want index.php to work we
>      # also automatically enable index.php
>      <IfModule mod_dir.c>
>          DirectoryIndex index.html index.php
>      </IfModule>
> </IfModule>
>
>
> This tells the Apache server to map the extension ".php" to the MIME-
> type that handles PHP scripts (in this case, the compiled PHP
> executable, shown here as the MIME-type "application/x-httpd-php").
>
> For more information, see http://httpd.apache.org/docs/1.3/mod/
> mod_mime.html#addtype
>
>
>
>
> On Dec 19, 2006, at 4:17 PM, Bob Patin wrote:
>
> > Is it mandatory to name a page containing PHP with the ".php"
> > extension?
> >
> > One of my friends told me that she has some pages with the ".htm"
> > extension, and because of the way her web server is configured,
> > these pages process their embedded PHP without trouble.
> >
> > I thought the PHP extension was mandatory, or did they change their
> > web server so that .htm pages are considered to be PHP pages also?
> >
> > Thanks,
> >
> > Bob Patin
> > Longterm Solutions
> > bob at longtermsolutions.com
> > 615-333-6858
> > http://www.longtermsolutions.com
> >
> >   CONTACT US VIA INSTANT MESSAGING:
> >      AIM or iChat: longterm1954
> >      Yahoo: longterm_solutions
> >      MSN: tech at longtermsolutions.com
> >      ICQ: 159333060
> >
> >
> > _______________________________________________
> > FX.php_List mailing list
> > FX.php_List at mail.iviking.org
> > http://www.iviking.org/mailman/listinfo/fx.php_list
> >
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list