Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ilia Alshanetsky's Blog:
Beware of the default Apache 2 config for PHP
Aug 31, 2010 @ 14:38:57

Ilia Alshanetsky has a suggestion for those setting up PHP and Apache2 for the first time - beware of the default configuration!

About a week ago, I was doing some upgrades on my development machine and came across a rather nasty issue when it comes to how .php(s) files are associated with PHP in Apache. It seems that a number of distros including Gentoo (which is what I was using) are using the [same] configuration directive to make the PHP module parse PHP files

The problem comes from their use of "AddHandler" versus "AddType" when telling Apache which files to parse as PHP. The first allows anything with ".php" in its filename to be parsed while the second limits it to just files ending in ".php". Check your configuration to ensure you're not open to this issue, especially if there's scripts/files outside of your control.

tagged: apache2 configuration problem parse addhandler addtype

Link:

Sameer Borate's Blog:
Pushing xpi mime content from php
May 20, 2009 @ 12:06:09

In this new post to his blog, Sameer shows how you can push content with the xpi content type out from your PHP scripts (for things like a Firefox toolbar/extension).

A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. Once installed on my blog I wanted Firefox to recognize it as an addon and install it rather than displaying a ’save/open’ dialog.

Since his hosting provider (GoDaddy) didn't seem to work with adding it into an .htaccess file (an AddType for Apache), he had to force the download type with a few calls to header with the right content type, file size and file name to push it to the user.

tagged: firefox extension apache addtype mime xpi

Link:


Trending Topics: