I wrote a PHP extension and it could be compiled and run under linux successfully. But on windows, I met some problems.
I did the compiling on windows according to http://blog.slickedit.com/?p=128 with PHP source version 5.2.10, and after the compiling it generated the dll file. But when I tried to use the dll file, it reported me the memory problems when starting Apache(Wamp server). And then I started the debugging process, it seemed that REGISTER_INI_ENTRIES() had problems.
Here is the PHP extension source code, http://www.bluefly.cn/xsplit.tar.gz , and it works fine on Linux. But I also want to make it work on Windows.
Sorry I am not a pro so that I hope someone can help me.
Any help is appreciated and thanks in advance~
The reason you’re not seeing an issue on Linux is most likely that you’re doing a thread safebuild on windows, but not on Linux. Try adding
--enable-maintainer-ztson Linux and then check using valgrind (USE_ZEND_ALLOC=0 valgrind /usr/bin/php script.php)From a quick glanceover your code I saw that you didn’t define your
php_xsplit_init_globalswhich initialized thread variables. Tis function has to be registered fromMINITby adding acall. Maybe something else is wrong, but that’s the first thing I saw.