1

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

@MatanTouti then, try to use LBW as I've suggested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.