Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do i have to compile a PHP extension on Windows to use it with Windows?

I'm trying to compile a "hello world" type extension on Windows 7, but I'm running into all kinds of problems. My end goal is to use the compiled extension with PHP (using wampserver2).

It it possible to compile the extension on Linux and still have it work on Windows?

I noticed all extensions in the ext folder in WAMP/PHP are .dll. Is there a way to produce a DLL for Windows on a linux machine, or do I have to compile on Windows too?

like image 351
sameold Avatar asked Dec 20 '25 07:12

sameold


1 Answers

It'd be possible to cross-compile, but then you'd need to have basically a windows development environment on the linux system (e.g. Wine) for the compiler to work with. The effort involved in getting that working to the point where the resulting .dlls work on a REAL windows system is most likely not worth it.

like image 51
Marc B Avatar answered Dec 22 '25 22:12

Marc B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!