--- title: ".php file — what it is and how to open it" description: "A .php file is a PHP Source. Server-side web code — it runs on the server, so browsers never see the source. How to open one on Windows, macOS and Linux, and what to convert it to." url: https://atoneplace.net/file/php/ site: "At One Place" --- # .php files **.php file: PHP Source** Server-side web code — it runs on the server, so browsers never see the source. ## What opens a .php file - **Windows:** Visual Studio Code, PhpStorm, Notepad++, XAMPP (to run it) - **macOS:** Visual Studio Code, PhpStorm, MAMP (to run it) - **Linux:** Visual Studio Code, Text Editor (built in), php -S (to run it) ## What a .php file is PHP powers WordPress and a large share of the web. A .php file is plain text mixing code with HTML, executed by the server which sends only the resulting page to the visitor. Double-clicking one locally shows the code rather than a web page unless you have a local server such as XAMPP, MAMP or PHP's own built-in server running. ## Converting it A .php file is commonly converted to .html or .txt. It is a plain text format, so any text editor can open and edit it directly. ## Details - **Extension:** .php - **Full name:** PHP Source - **Category:** Code and scripts - **MIME type:** application/x-httpd-php - **Created by:** The PHP Group - **Format:** Plain text ## Common questions ### How do I open a .php file? On Windows use Visual Studio Code; on macOS use Visual Studio Code; on Linux use Visual Studio Code. Server-side web code — it runs on the server, so browsers never see the source. ### What is a .php file? PHP Source. PHP powers WordPress and a large share of the web. A .php file is plain text mixing code with HTML, executed by the server which sends only the resulting page to the visitor. ### Can I convert a .php file? Yes. It is usually converted to .html or .txt, either by exporting from one of the programs listed above or with a format converter. ## Related pages - [.html — HyperText Markup Language](https://atoneplace.net/file/html/) - [.js — JavaScript Source](https://atoneplace.net/file/js/) - [.css — Cascading Style Sheet](https://atoneplace.net/file/css/) - [.py — Python Source](https://atoneplace.net/file/py/) - [.java — Java Source](https://atoneplace.net/file/java/) - [.tsx — TypeScript Source (JSX)](https://atoneplace.net/file/tsx/) - [.cpp — C++ Source](https://atoneplace.net/file/cpp/) - [.c — C Source](https://atoneplace.net/file/c/) - [.cs — C# Source](https://atoneplace.net/file/cs/) - [.go — Go Source](https://atoneplace.net/file/go/) - [.rs — Rust Source](https://atoneplace.net/file/rs/) - [.rb — Ruby Source](https://atoneplace.net/file/rb/) ## Sources - Media Types Registry — IANA (https://www.iana.org/assignments/media-types/) - Official vendor product documentation — At One Place (/about/)