php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61941 Compiled script on Win32 wont work on Linux
Submitted: 2012-05-04 18:40 UTC Modified: 2017-01-10 07:59 UTC
Votes:4
Avg. Score:3.5 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: gug at mail dot ru Assigned:
Status: Suspended Package: bcompiler (PECL)
PHP Version: 5.3.12 OS: Win32+CentOS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-05-04 18:40 UTC] gug at mail dot ru
Description:
------------
I've compile script at Windows:

<?php echo 'test';

by second script:
<?php
$fh = fopen("out.php", "w");
bcompiler_write_header($fh);
bcompiler_write_file($fh, "test.php");
bcompiler_write_footer($fh);
fclose($fh);

In Windows, when I open browser and point to http://localhost/out.php i've got correct result - compiled script says "test". It's correct!

BUT if I copy this compiled script in Linux (CentOS el5 x86_64), script opens AS IS! (bcompiler v0.27s ����(test>����(N:\home\localhost\public_html\out.php����n����ine/temp����). Anyway how I've open that: in browser or console (php ./out.php) - its show me file as is.

If compile test.php exactly in destination Linux, out.php will work fine!

And otherwise, if compile at Linux - it's won't work on Windows.

When i've transfer file (SFTP, binary mode), MD5SUM correct in Windows and Linux.

Windows:
5.3.10
Apache 2.0 Handler 
Thread Safety 	enabled 
PHP API 	20090626
PHP Extension 	20090626
Zend Extension 	220090626
Zend Extension Build 	API220090626,TS,VC9
PHP Extension Build 	API20090626,TS,VC9 
bcompiler version 	1.0.2s 

CentOS:
5.3.6
Apache 2.0 Handler 
Thread Safety 	disabled 
PHP API 	20090626
PHP Extension 	20090626
Zend Extension 	220090626
Zend Extension Build 	API220090626,NTS
PHP Extension Build 	API20090626,NTS 
bcompiler version 	1.0.2s 

Test script:
---------------
<?php echo 'test';

Expected result:
----------------
test

Actual result:
--------------
bcompiler v0.27s ����(test>����(N:\home\localhost\public_html\out.php����n����ine/temp����

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-05 07:08 UTC] alan_k@php.net
Sounds likely - You might need to compare the two files using an hex editor to 
find out what is different. The file format should be pretty simple to 
understand.
 [2012-05-05 09:26 UTC] gug at mail dot ru
There is:

http://img859.imageshack.us/img859/231/capture05052012132108.png
http://img694.imageshack.us/img694/429/capture05052012132110.png

Seems that they have different header and some else...
 [2012-06-28 10:35 UTC] icukeng at gmail dot com
Looks like your windows box is 32bit and linux box is 64 bit.
binaries will not work on differ arch
 [2012-06-28 11:10 UTC] gug at mail dot ru
Thanks for comment, but linux i386 and Windows 32 have similar problem: compiled at linux wont work on windows and compiled ad windows wont at linux.

But windows have PHP/5.3.10, linux have PHP/5.2.5 - its important?
 [2017-01-10 07:59 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-01-10 07:59 UTC] kalle@php.net
Suspending this report as the extension have not had a release for almost 6 years.  Please revive this if the extension once again shows life
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:25 2019 UTC