Matan Touti
Matan Touti

Reputation: 191

execute binary file on localhost

I'm trying to execute a binary file (file.bin) with a PHP script on my localhost on windows under Apache 2.4.3.

What I have tried:

<?php echo exec('c:\file.bin'); ?>

Besides exec i have tried shell_exec and system.

I gave to file.bin a a executable permissions for all users: (chmod a+x file.bin), in my linux. Then I passed the file.bin to my windows and also checked that it had execute permissions for all, and it has. I also checked the file.bin on linux and its working just perfect: (./file.bin)

The problem: What i get is that my browser keep waiting and don't show anything.

any ideas?

can i execute a bin file under Apache localhost that runs under windows? if i cannot, is there any solution to running a bin file under windows?

Thank you a lot.

Upvotes: 1

Views: 1775

Answers (1)

Alma Do
Alma Do

Reputation: 37365

You can not act like this way. Despite all permissions - you're trying to execute linux binary file under Windows. That will not work since they are different by architecture. Win32 executables (.exe) have nothing to do with Linux binary files.

Possible solution - but only if you have source code of your binary Linux application - compile it under Windows/for Windows - this is the most correct way. Otherwise, there is LBW project, which in most cases will allow you to do desired stuff.

Upvotes: 1

Related Questions