Htaccess AddHandler *** x-httpd-php5x *** and *** application / x-httpd-php5x ***

What is the difference between x-httpd-php5x and application/x-httpd-php5x

I used application/x-httpd-php for many years with my web hosting ( Linux ) until they upgrade PHP to version> = 5.2. Now I have to use x-httpd-php5x on a web hosting that does not work on localhost ( Windows ).

Therefore, every time I made some changes to .htaccess, I should also change AddHandler during upload to web hosting.

Is there a cross-platform AddHandler for parsing files like PHP?

Edit

.php can always work, with / without specifying in .htaccess. but not user extensions e.g. ..myphp

+4
source share
1 answer

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 which version of PHP they belong to.

application/x-httpd-php is partly deprecated because in fact it does not reference any version. This was good in the early days of PHP, but as the number of versions grew, there was a need for something more specific.
Most web hosts currently support multiple versions of PHP, and their web servers use media types to transfer the correct files to the correct PHP interpreters.

If your local development machine is equipped with PHP 5.1 or lower, this is probably the reason why it does not support media types for PHP 5.2 and higher.

A little off topic: if you have installed PHP 5.2 or lower, I would advise you to upgrade to PHP 5.3 or higher. At the time of this writing, all versions below 5.3 are outdated.

+2
source

Source: https://habr.com/ru/post/1440548/


All Articles