How do I enable .phps file to be color highlighted?

Browse by products and services

  • Applies to: Grid
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, vi knowledge


Due to the way PHP is configured on our Grid platform, there is a work around to get a .phps file displaying colorized.


You will need to add the following to your .htaccess and create the source.php file somewhere in you path.

Edit or create a .htaccess file in the root of the domain you want to host .phps files, then add this code to the .htaccess file:

Action php-source /test/source.php
AddHandler php-source .phps

Next, create a test/source.php file and add this to the file:

<? highlight_file($_SERVER{"DOCUMENT_ROOT"} . $_SERVER{"PATH_INFO"}) ?> 

Save the files and you will now be able the view the source of .phps files in color.