Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am taking over an application server and discover that it contain the following settings:

AddType text/html       php

Although it works, but my understanding is that it should set as following:

AddType application/x-httpd-php php .php

What are the key differences between the two settings? Although at this point my application (Built using CakePHP) is running fine with either configuration, but I am not sure if it will cause any strange behaviour.


share|improve this question

The mod_mime AddType definition from the Apache httpd docs:

The AddType directive maps the given filename extensions onto the specified content type. MIME-type is the MIME type to use for filenames containing extension. This mapping is added to any already in force, overriding any mappings that already exist for the same extension. This directive can be used to add mappings not listed in the MIME types file

In short AddType text/html php tells httpd to specify the Content-Type header for PHP files to be text/html. Which is correct since it is used by the client side browser and not the server itself.

What tells httpd to handle the files as PHP is the SetHandler directive:

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php

The PHP configuration instructions explain the SetHandler directive in relation to PHP as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.