PHP PHPS
File conversion

Convert PHP to PHPS

QUICK ANSWER
Is it possible to convert PHP to PHPS?
Yes - PHP converts to PHPS.

A .phps file is the same PHP source code as a .php file - only the extension differs, telling Apache to display the source with syntax highlighting instead of executing it. Rename the file and add one AddType directive to Apache; no conversion tool is needed.

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

Why convert PHP to PHPS?

The only reason to use .phps is to let visitors read PHP source code in a browser with colour-coded syntax without the server executing it, which is useful for code tutorials or public demos where the source itself is what you want to show.

How to convert PHP to PHPS

Apache web server FREE

Rename the .php file to .phps, add AddType application/x-httpd-php-source .phps to your Apache config or .htaccess, and restart Apache.

XAMPP FREE

Install XAMPP, rename the .php file to .phps, add the AddType directive to XAMPP's Apache config, restart Apache from the XAMPP control panel, and browse to the file to verify the syntax highlighting.

About these formats

Quality & what to watch

  • The .php and .phps files are byte-for-byte identical; only the extension changes, which tells Apache which handler to invoke.
  • The .phps source handler is an Apache feature - Nginx has no built-in equivalent.
  • Never expose files containing database passwords or API keys as .phps; any visitor who browses to the URL can read the full source.

Frequently asked questions

Do I need a special converter to change .php to .phps?
No - a simple rename is all that is needed because the file content is unchanged.
Does .phps work on shared hosting?
Often not - many shared hosts do not enable the .phps handler and do not permit the required AddType directive in .htaccess.
Can I test .phps locally?
Yes - XAMPP or MAMP both run Apache and can be configured to handle .phps files on your local machine.