What is the difference between x-httpd-php5x
and application/x-httpd-php5x
I'v been using application/x-httpd-php
for years with my web hosting (Linux) until they upgrade PHP to version>=5.2. Now I have to use x-httpd-php5x
on web hosting which does not work on localhost (Windows).
So everytime I made some changes to the .htaccess, I have to change the AddHandler as well while uploading to web hosting.
Is there a cross-platform AddHandler
to parse files as PHP?
edit
.php can always work, with/without specifing in .htaccess. but not custom extesions, e.g. .myphp
The media type
application/x-httpd-php5
was introduced specifically for PHP 5.0,application/x-httpd-php51
for PHP 5.1,application/x-httpd-php52
for PHP 5.2, etc...In other words: the difference between them is to which version of PHP they are referring.
application/x-httpd-php
is kind of obsolete, because it doesn't really refer to any version. This was fine in the early days of PHP, but as the number of versions grew, there was need for something more specific.Most webhosts nowadays support multiple versions of PHP, and their webservers use the media types to pass the correct files to the correct PHP interpreters.
If your local development machine has PHP 5.1 or below installed, it's probably the reason why it doesn't support media types for PHP 5.2 and up.
A bit off-topic: If you have PHP 5.2 or below installed, I would advise you to upgrade to PHP 5.3 or up. At the time of this writing all versions below 5.3 are deprecated.