SwiftlyTilting: usability, reusability

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 2361 times

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

1 Comment Leave Comment

I’ve been using BamCompiler for a while and it does work quite well for me except foreach and key stuff.. and works only for PHP4 :(.
Now I need to set up a php script as a service as I don’t want to remember every time to start a little tool I wrote manually and even if I’m not logging on.
I was trying to create a WindowService and the only way to do seems to use PECL which I found here:


Now the problem seems to be that PECL is version PHP 5.2 it is not compatible with PHP 5.3.1 inside phc, so I get an error:

—— cut here ——–
win32service_sampleV.1.7.exe -install
PHP Warning: PHP Startup: win32service: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0
PHP Version: [5.3.1]
—— cut here ——–

I was using phc-031.
Can you suggest me how solve the problem?
-1- Do I need to get back to PHP 5.2 in phc?
a) How? Just override the DLLs ? Is it possible to redirect to a different dir
to get old 5.2 DLLs for specific projects?
-2- Can I find Win32Service.dll (from PECL) for PHP v.5.3.1 as phcWin?

Note: Win32std is different from Win32Service.

Thanks a lot for your support.. I’m going to keep on with my php damned WindowService hard experiments .. ;)


Comment by Luca Regoli — Saturday, January 30, 2010 @ 4:43 am

Leave a Comment

Validate XHTML | Word Press