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 617 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.


10 Comments Leave Comment

Does it support UPX?

Comment by KoczkaHUN — Wednesday, December 30, 2009 @ 11:10 am

I believe so, but I haven’t tested to confirm.

Comment by swiftlytilting — Wednesday, December 30, 2009 @ 8:05 pm

Jeez.. I am new to programming but I learnt how to use imacros and therefore I thought of making an app and perhaps giveaway or sell it online but I don’t know how to convert files into exe..

I tried to convert it into VBS form and couldn’t find an opensource vbs to exe.. later I thought, hey why not convert to php and then exe.. I came across many posts. Only your webpage looked genuine and I tried hell lot of unknown programs, don’t know how to operate them. What advice would you give me? Php to exe or vbs to exe or c# to exe?

And, I have downloaded older phc version.. trying to figure out things still. But, I am looking forward for your advice :)

Thanks and have a nice year ahead.

Comment by Rockstar Sid — Friday, January 1, 2010 @ 12:50 am

Hi Sid

If you are trying to pick a language to learn and make EXEs, PHP might not be the best option. If you already know PHP and would like to make tool using PHP, then phc-win is very useful. But in general PHP isn’t well suited for application building.

By the way, Microsoft gives away a “lite” version of Visual Studio, perhaps there is a VB version?

Comment by swiftlytilting — Sunday, January 3, 2010 @ 10:14 pm

Hi all,
I must say phc-win seems to be a quite good product but seems even to miss right what I’d need :(
The missing DLL that seem not to be supported are (at least):

- php_shmop.dll (necessary fir IPC Inter-Process-Communication)
- php_win32service.dll (necessary for creating Windows Services that respond to start/stop WinServiceManager commands)

For both I receive the infamous error:

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

Fatal error: Call to undefined function shmop_open() in
test.php on line 124

The php-embed.ini of course contains:
—— cut here ——-
..
..
extension=php_shmop.dll
extension=php_win32service.dll
—— cut here ——-

That’s really a sin.
I’ve extracted the (dated 25-09-2008) from the phpV530 distribution.
Instead, the “php_win32service.dll” (dated ‎06-08-2008) from pecl5.2-win32-200808060430.zip found googling around on:
http://snaps.php.net/win32/

Unfortunately I don’t have more recent pecl DLLs neither for “php_win32service.dll” nor for “php_shmop.dll”.

BTW it could be nice to be able to run phc from the command prompt or at least have drag-n-drop enabled (drag a PHP to get the exe) in order to automatize the exe production.

Thanks a lot in advance for any eventual hint!
L.R.

P.S. Sorry for the possible cross-posting (I wasn’t able to find back my already sent msg).

Comment by Luca Regoli — Sunday, January 31, 2010 @ 4:13 am

Hi Luca

That means you must compiled the DLL with VC9, not the VC6 version. I guess the ones currently on the pecl website are compiled with VC6.

As for command line, I plan on offering that in my next release :)

thanks for the using phc-win

Comment by swiftlytilting — Wednesday, February 3, 2010 @ 8:28 am

win32service is available here: http://downloads.php.net/pierre/ download a version with VC9 in the name. Choose the thread safe versions (TS)

Comment by swiftlytilting — Wednesday, February 3, 2010 @ 9:35 am

Hey!
I found the necessary DLL and it does WORK with phc-win 0.3.1

http://downloads.php.net/pierre/

It should be this:

http://downloads.php.net/pierre/php_win32service-svn-20091117-5.3-nts-VC9-x86.zip

or this:

http://downloads.php.net/pierre/php_win32service-svn20091206-5.3-nts-vc9-x86.zip

I’ve already forgotten!
Anyway it works.

No way for the SHMOP unfortunately.

Now I’m trying to figure out how to read a configuration file in the same dir..

Bye

Luca

Comment by Luca Regoli — Wednesday, February 3, 2010 @ 10:39 am

Hey I found a very strange behavior of phc-win 0.3.1!
I compiled my test appl under my XP machine at work and it works. The same I did at home with Vista (argh!!!!) and it works (unbelievable! ;)).
Now that’s the foolish thing: at work I use 4 servers all of them are Windows Server 2003 Standard Ed. SP2 (as far as I remember).
Well let’s name them S1, S2, S3, S4 (S1 and S2 have 2 giga of ram, S3 and S4 have 4 giga of ram). Same Xion processors. All machines have the same load (very low only I/O). S1 and S2 are 4-processor. S3 and S4 are 8-processor machines.

Well my test executable works only on S3! On S1 won’t run saying it’s not an executable (I don’t recall exact error but I can tell you later). On S4 it runs only after a while. Let say I run it like “test.exe -h” at the command prompt (as it is a console application) I have to wait about 40 seconds then I get the output !!!!! Of course in S3 the help answer is immediate, less than a second to do the same operation. As expected and as it works on the clients!
Any ideas??
This morning if I have time I’ll try to build a win appl instead of console one so I can test if there is a problem in the EXE building as I’m lead to think.

BTW thanks for previous answers ..I saw them just now!

Luca

P.S. I do hope I’ll have time soon to look into the code to write a REDO button/menu item..

Comment by Luca Regoli — Tuesday, February 9, 2010 @ 9:50 pm

Hi Luca

Thanks for the report on different OS versions. I’m not able to offer much help as I’m not an expert in windows executables. It seems PHP 5.3.0 might only be 100% compatible with Windows XP SP2 and up. In the past the biggest complaint about phc-win is that it wasn’t up to date, so now I want to keep moving forward and not worry so much about backward compatibility.

Comment by swiftlytilting — Tuesday, February 9, 2010 @ 10:44 pm

Leave a Comment

Validate XHTML | Word Press