ApplicationText-based

application/x-httpd-php

PHP

Reference for application/x-httpd-php, the MIME type for PHP source files processed by web servers like Apache and Nginx.

MIME Type Detector

Drop a file to detect its MIME type — no upload, runs in your browser

📄

Drop any file here or click to choose

Expected extensions: .php, .phtml

HTTP Content-Type Header

HTTP Header
Content-Type: application/x-httpd-php; charset=utf-8

Associated File Extensions

.php.phtml

Quick Facts

MIME Typeapplication/x-httpd-php
CategoryApplication
TypeText-based (human-readable)
Extensions.php, .phtml

Common Usage

PHP files are server-side scripts executed by the PHP interpreter. Web servers like Apache use this MIME type to route .php files to the PHP handler.

PHP powers WordPress, Laravel, Drupal, and approximately 77% of websites with a known server-side language.

Code Examples

HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.php" type="application/x-httpd-php">

<!-- Or for script/media elements -->
<script type="application/x-httpd-php" src="file.php"></script>
Node.js
// Express.js
app.get('/file', (req, res) => {
  res.type('application/x-httpd-php');
  res.send(data);
});

// Node.js http
res.writeHead(200, { 'Content-Type': 'application/x-httpd-php' });
nginx
# nginx.conf — add to types block or use default
types {
    application/x-httpd-php  php phtml;
}

# Or set for a specific location
location /api/ {
    default_type application/x-httpd-php;
}

Related MIME Types

More Application MIME Types

Other application types in the Application family

Related Tools

Explore More MIME Types

Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.