SwiftlyTilting: usability, reusability

Thursday, December 17, 2009

phc-win 0.3.1 - a PHP EXE compiler

The bugs in bcompiler seem to have been worked out since phc-win 0.3.0. Unlike 0.3.0, this release has the standard PHP DLLs (for PHP 5.3.1) and separate Winbinder, win32std and bcompiler DLLs. I’m hoping to be able to get a smaller DLL with all of the required extensions going, but for now this is better than the buggy bcompiler version.

If you find php-win useful, please consider making a small donation.


View the phc-win documentation.

Download phc-win 0.3.1
Downloaded 1799 times

Note to XP users:
You may need to install the Microsoft Visual C++ 2008 Redistributable Package (x86) for EXEs to run correctly.

Note to Windows 2000, 9x Users
Due to a change in 5.3.x series of PHP, phc-win does not work on Windows 2000 or 9x machines. There are no plans to compile a 5.2.x series binary for phc-win. If you cannot upgrade your OS, I recommend using phc-win 0.2.1 which uses PHP 5.0.5.

Check the phc-win category for the latest version.

Wednesday, December 16, 2009

phc-win 0.3.0 - a PHP EXE compiler - compatible with PHP 5.3.1

It’s been quite a while since phc-win was updated due to the difficulty of getting all of the extensions compiled and running with each new version of PHP. Finally I got WinBinder compiled with PHP 5.3.1, and Alec Gorge helped out and compiled some lightweight DLL files to use with phc-win.

The good:
* PHP 5.3.1 compatible
* Program EXEs need only 1 DLL file and no other files to run correctly (if using one of the Alec Gorge compiled DLLs)
* Included DLL is only 2.44 megs

The bad:
* it seems bcompiler has changed since the last update of phc-win. Unfortunately it has introduced an error which causes programs to crash if your PHP code uses constants as default function parameter values. IE function foo ($bar = CONSTANT_VALUE) will cause the a program crash. Other problems may also exist with bcompiler. Because of this I may need to make the bcompilation stage optional.

UPDATE: Bug reports have been submitted to the bcompiler team and they are working on it, so hopefully there will be a resolution to this issue. Update 2: phc-win 0.3.1 is packaged with updated bcompiler dlls.

This version of phc-win has no actual functionality changes from 0.2.1 besides minor tweaks to get things working with php5.3 and working around the bcompiler issues.

If you find php-win useful, please consider making a small donation.


Download phc-win 0.3.0
Downloaded 1253 times

For the latest version, check the phc-win category.

Monday, September 7, 2009

SwiftlyTilting Wiki (re)Launches!

The wiki at SwiftlyTilting.com has received a face lift. I’ve also added documentation for all of my MediaWiki extensions, and there is a new sandbox area for users to try out Winter and my other extensions as well.

wiki.SwiftlyTilting.com

Tuesday, March 7, 2006

phc-win 0.2.1 - bugfixes

As expected, there were some bugs with the first release of phc-win. The biggest problem occured whenever the path of the program file or any code contained a space: it simply wouldn’t compile the code. That has been fixed in this version. Some other minor bug fixes as well. PHC-WIN is compatible with PHP 5.0.5

phc-win 0.2.1 rar archive
Downloaded 5629 times
phc-win 0.2.1 upgrade rar archive
Downloaded 1269 times
For the latest version, check the phc-win category.

Monday, March 6, 2006

phc-win: A PHP compiler for Windows

PHC-WIN is a windows application that allows one to create EXEs from PHP code. The PHP code is first converted to PHP bytecode using bcompiler, and then embedded into an EXE using embeder. Compiling the code into bytecode has two benefits: it speeds up load times since the PHP code doesn’t have to be interpreted, and it obfuscates the code so that it cannot be easily reverse engineered.

PHC-WIN itself is written in PHP and utilizes wbObjects, my object oriented layer for WinBinder to create windows controls.

PHC-WIN Wiki page with documentation

Download:
phc-win 0.2.0 rar archive
Downloaded 2605 times
phc-win 0.2.0 self extracting exe
Downloaded 3184 times
For the latest version, check the phc-win category.keywords: php to exe, php2exe

Wednesday, March 23, 2005

PHC update

Well it looks like there was a major problem with the first release of PHC; it only worked correctly in Windows 98! I’ve fixed it to work correctly in WinXP, and also streamlined the console/window program type selection.

PHC-SDK v0.11

[UPDATE: PHC has been obsoleted by phc-win]

Monday, March 21, 2005

PHC - A PHP to EXE compiler

UPDATE: PHC has been obsoleted by phc-win

Since PHP is so powerful, it is natural one would like to develope Windows applications with it. GUI extensions such as PHP-GTK and Winbinder allow users of the PHP command line interface to display GUI widgets in Windows, but the problems of distribution and code exposure still remain. The PHP command line interpreter must be included in any distribution, and the code is left as a text file.

There are a few open source PHP to EXE “compilers” out there, such as PriadoBlender and Embeder that utilize the PHP SAPI to include PHP code in executable files, but most still leave the PHP code plain or obfuscated in such a way that it is accessible to anyone who has a few minutes. PriadoBlender includes you code in an encrypted file, but it’s not much different than running the command line interpreter as the decryption code is exposed as plain text PHP inside the executable. I wanted to find something that would not allow recreation of the exact code. There are a few commercial applications out there that will do this, but they are ridiculously expensive, and inaccessible to the open source community.

In my search for a more elegant solution, I saw a few mentions of the bcompiler extension for PHP that seemed to do everything I wanted; it would join the code and the EXE file, and the code would be converted into PHP byte code, making it much harder to view and reverse engineer. The need for the PHP runtime DLL was still present, but that seems to be true of every PHP compiler, and is akin to the runtime libraries needed for Visual Basic applications.

The only problem was, you needed MS Visual Studio to compile two essential files, and only one was easily accessible. There isn’t much information on bcompiler, but eventually I found this article that mentioned the only known existing copy of the file I was looking for could be found packaged with another program by the author of bcompiler. Even when I did find the two essential files, I found they didn’t work with my PHP runtime, and had to use the one included in the above mentioned package.

Considering how useful bcompiler is, it’s a shame that it is so hard to obtain all of the components needed to produce usable EXEs. So now that I’ve collected all of the needed files, I’ve compiled the compiler script into a stand alone EXE. I present it as PHC, a PHP compiler. It is included in the PHC-SDK, which also includes the full source of PHC as well as a few simple examples to get you started, including two utilizing Winbinder to produce GUI widgets

Download the PHC-SDK with PHC v0.11 (updated from 0.1 because it seemed many people were downloading 0.1 which doesnt work in WinXP)

UPDATE: PHC has been obsoleted by phc-win

Validate XHTML | Word Press