PHP compiler or top2ec named The Other Php 2 Exe Compiler

Here is my last work: The Other Php 2 Exe Compiler or TOP2EC V.0.4.1.

It is just a newer or highly revised version of PHC-WIN 0.31 (end of 2009) by Andrew Fitzgerald with some add-ons like:

  1. one button compile (if entry field is filled with an existing PHP file)/recompile;
  2. extensive log and code tracing: if a syntax error arises in the multi-step compile process it is now shown on the edit window;
  3. automatic recompile in dir compile of newer modified php sources files;
  4. inside the full dir compile option, you can include only *.PHP, *.ICO, *.RC, *.BMP, *.CONFIG files or all as before (plus from 0.4.0 added an exclude dir);
  5. save size and position of the main window;
  6. you can remove *.PHB (PHp compiled Binaries) automatically.
  7. store configuration settings in “.config” file containing last compiled 7 files with their own compilation attributes that you can recall from the menu;
  8. added UPX executable compression;


Enjoy the download and report to contact inside if you find a bug or come to the forum here.

Please follow all the notes you can find in the url: about that compile as top2ec follows the same track of phc-win.


Follow up add on or modifications to the main message:


Note 2010-Nov-04: I found some problems trying to run it under windows XP. Just in case try to recompile sources with the COSOLLE option and should work. I’m investigating the problem and soon will apply some more debbugging.. V 0.3.8 will arrive to fix it.

Note 2010-Nov-13: V 0.3.9 is here. It seems to be stable, please, check it to verify and warn me in case of problems.

Note 2010-Nov-21: V 0.4.0 is here. I just added some minimal new features:

  1. Added below the “Compile” pushbutton a combo box containing a number 1-10 that is the loglevel used to display minimal or maximal debug informations.
  2. I just started minimal redesign of loglevel display of informations.
  3. established an “exclude” directory that will allow to exclude some code we’d like not to remove from the directory but we don’t like to be compiled inside our exe’s code. *** WARNING *** avoud using the keyword exclude or EXClude or whatever variant within the path. The routine just avoid adding the resource although compiling the *.PHB file. In a future version this won’t even compile the *.PHP* inside that directory.

Note 2011-Jan-28: V 0.4.1 is here. I just set uo some fixes. I found a misbehavior I wasn’t able to reproduce. Sometime at the first compile the generated binary phb is 0 KByte length. This usually happens when a syntax error occurs in the code, but there were non syntax errors! Anyway the code seems to be stable.

In the next version I’d like to add some easy feature like post compilation task commands (like copy exe to a specified location (very helpful when you need to apply a new version in a server..) Let’s see when I’ll have time for this!

Luca Regoli