Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

Text Search PHP files

written by Mark Rowlinson - Last updated Mar 2006

Introduction

When trying to debug somebody else's application it can be difficult to determine which file to look in to find the function that has been called when the application is large and contains many includes. This problem is worsened by the fact that as windows doesn't recognise PHP files it will ignore them when you search for files with a specified word or phrase in them.

Debugging aside this is an annoying feature. The steps in this article will address this.

Health Warning

I should add a health warning here that this has only been tested on Windows XP Pro so please use with care in other versions of windows. It would be good practice to take a back up of the registry before adding the keys.

How to Make the Change

Getting windows to search PHP files is a simple matter of adding a few regstry keys.

Step 1

Create a new text file

Step 2

Add the following text to it:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.php\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ContentIndexCommon\Filters\Extension\.php]
@=hex(7):7b,00,43,00,37,00,33,00,31,00,30,00,37,00,32,00,30,00,2d,00,41,00,43,\
  00,38,00,30,00,2d,00,31,00,31,00,44,00,31,00,2d,00,38,00,44,00,46,00,33,00,\
  2d,00,30,00,30,00,43,00,30,00,34,00,46,00,42,00,36,00,45,00,46,00,34,00,46,\
  00,7d,00,00,00,00,00

This adds 2 regsistry keys relating to 2 different search methods. Both of the GUID's relate to Filters that apply for text files.

Step 3

Rename the file to have the extension .reg

Step 4

Backup the registry unless you are very trusting!

Step 5

Double click the file and hit Yes when asked if you would like to merge the data into the registry.

Step 6

Reboot the PC.

PHP files will now be searched by the windows text search!

Other files

The approach can be easily modified to specify any other filetype you believe windows is ignoring by changing the .php in the text to the extenson of the files you wish windows to start searching.

Hope this saves you some time!