.php

What is a .php file?

PHP is a server-side scripting language — powering WordPress, Laravel, and a massive portion of the web.

Use caution
Type Code
By Rasmus Lerdorf
MIME application/x-httpd-php

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

You're looking at a .php file — a server-side script that generates HTML. PHP powers WordPress (43% of all websites), Laravel, Drupal, MediaWiki, and a massive portion of the web that people don't realise is PHP. If you've ever interacted with a web form, bought something online, or read a blog, PHP probably processed the request.

Rasmus Lerdorf created PHP in 1994 as a set of C scripts for his personal home page (hence "Personal Home Page," later renamed "PHP: Hypertext Preprocessor" — a recursive acronym). The language grew chaotically, accruing inconsistent function names, weak typing surprises, and security patterns that made developers wince. Modern PHP (8.0+) is genuinely good — typed properties, match expressions, named arguments, fibers — but the reputation from the messy years lingers.

VS Code with PHP extensions handles syntax highlighting and IntelliSense. PhpStorm (JetBrains, paid) is the premium IDE. To run PHP, you need a web server with PHP installed — XAMPP and Laravel Valet are the quickest local setups. PHP files execute on the server and return HTML to the browser — you can't run them by double-clicking.

Technical details
Full Name
PHP Script
MIME Type
application/x-httpd-php
Developer
Rasmus Lerdorf
Magic Bytes
N/A
Safety
.php requires caution. PHP files execute server-side code. Only run on trusted servers.
What opens it
Any text editor
FREE All
VS Code
FREE All
PhpStorm
Subscription All
FAQ
Is PHP still worth learning?
If you're working with WordPress, Laravel, or any existing PHP codebase — yes. PHP powers a massive portion of the web and has a huge job market. Modern PHP (8.0+) is a genuinely capable language. For greenfield projects, you have more choices, but PHP is far from dead.
Can I run a PHP file without a server?
You can use PHP's built-in development server: `php -S localhost:8000` in the directory containing your PHP files. For production, you need a proper web server (Nginx, Apache) with PHP configured.
Related formats