For protection of your PHP scripts, you will do the following two steps:
1. Encrypt your PHP scripts.
2. Install needed library which will allow you to run protected.
First Step: Encrypt your PHP scripts
For encryption/decryption of your scripts you should run PHTML Encoder converter (as GUI or console tool).
GUI version is easier. You can choose source script or scripts directory, change target directory. Please select options copy other file, make self-decodable scripts and with sub-dirs by your wish.
After this you should press Encrypt or Decrypt button for encryption/decryption despectively.
Also you can use console version of above tool.
Open a Command Prompt window and change dir to the PHTML Encoder directory.
Type phtmlec.exe with following options:
"phtmlec.exe [-switch]... function source [target]" ,
here -switch - one or more switches from following list:
-r - include subfolders
-d - delete source file(s) after encription/decryption
-c - copy other (non-script) file(s).
-s - make self-decodeable script(s).
-w parameter - use wildcards for files, parameter is wished wildcards (default *.php,*.php4,*.inc), see above wildcard rules.
function - {e|d} : e - encryption, d - decryption;
source, target - input and output file or directory name; If don't output file is specified source file is used for output.
Example 1: "phtmlec.exe e index.php index1.php" (encryption of index.php to index1.php)
Example 2: "phtmlec.exe d -r -c -w admin*.php C:\WWW\ C:\WWW2\" (decryption of files admin*.php from directory C:\WWW to C:\WWW2 with subdirectories and copying other files).
For PHTML Encoder testing you can use test.php and teste.php in PHTML Encoder directory.
The file teste.php is encoded equivalent of test.php.
Second Step: Install PHTML Encoder
There are three ways to implement PHTML Encoder:
The first method requires no changes to PHP installation, but you must put a phtmlenc-4.X.X.dll in every PHP script directory. The other two options require change to PHP installation. Details for each installation method follows:
1. Self-decodable scripts
Self-decodable scripts require a phtmlenc-4.X.X.dll library file in every PHP script directory. Copy the correct phtmlenc-4.X.X.dll file in PHTML Encoder directory, where X.X is a version of your PHP engine.
2. Install PHP extensions
Copy the correct extension file to the PHP extensions directory or your Windows path. Please use the 'phtmlenc4.X.X.dll' file in PHTML Encoder directory, where X.X is a version number of your PHP engine. Find PHP.INI file for 'extension_dir' parameter. Add 'extension='phtmlenc4.2.1.dll' string to your PHP.INI file to this section. To confirm that your extension is being used, run phpinfo(). Results must contain the 'PHTML Encoder v.3.3 extension | enabled' string.
3. Replace PHP engine library
To replace the PHP engine library, you must replace a file named 'php4ts.dll' on your system with the php4ts.dll from PHTML Encoder distribution package. Typical locations of existing php4ts.dll library are C:\PHP\ or C:\WINNT\System32.
Important: BACKUP your existing php4ts.dll file prior to replacing it with the new one.
Make sure you have replaced the needed library. To make sure, leave the web server running and then try renaming the existing php4ts.dll file. If this operation is forbidden by system, then this is exactly the library you need. Stop your web server, replace the library and start your web server again.