Compiling my own PHP extension on Windows with Visual Studio 2008

I wrote a PHP extension, and it could be compiled and run under Linux. But in the windows I met some problems.

I compiled on windows according to http://blog.slickedit.com/?p=128 with the original version of PHP 5.2.10, and after compiling it generated a dll file. But when I tried to use the dll file, it informed me about memory problems when starting Apache (Wamp server). And then I started the debugging process, it seemed that REGISTER_INI_ENTRIES () was having problems.

Here is the source code for the PHP extension, http://www.bluefly.cn/xsplit.tar.gz , and it works great on Linux. But I also want it to work on Windows.

Sorry I'm not a professional, so I hope someone can help me.

Any help is appreciated and thanks in advance ~

+3
source share
2 answers

The reason you don't see the problem on Linux is most likely you are making a thread safe structure on Windows, but not Linux. Try adding --enable-maintainer-ztsto Linux and then checking with valgrind ( USE_ZEND_ALLOC=0 valgrind /usr/bin/PHP .php)

With a quick look at your code, I saw that you did not define your own php_xsplit_init_globals, which initialized the flow variables. The Tis function must be registered from MINITby adding

ZEND_INIT_MODULE_GLOBALS(xsplit, php_yplist_init_globals, NULL);

call. Maybe something else is wrong, but this is the first thing I saw.

+2
source

Wamp VC6 , VC6.

Romain Bourdon ( WampServer): Apache VC6, PHP ( WampServer), VC6.

, PHP-CGI () CGI.

( , ), .

+2

Source: https://habr.com/ru/post/1711142/


All Articles