microsoft / php-sdk-binary-tools

Tool kit for building PHP under Windows
BSD 2-Clause "Simplified" License
270 stars 79 forks source link

Persistent Connection with mysqli : define MYSQLI_NO_CHANGE_USER_ON_PCONNECT for Windows build #46

Closed xixibu closed 5 years ago

xixibu commented 5 years ago

On page https://dev.mysql.com/doc/apis-php/en/apis-php-mysqlnd.persist.html , it introduced how to disable change user for persistent connection as follows: shell# CFLAGS="-DMYSQLI_NO_CHANGE_USER_ON_PCONNECT" ./configure --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --enable-debug && make clean && make -j6 or shell# export CFLAGS="-DMYSQLI_NO_CHANGE_USER_ON_PCONNECT" shell# configure --whatever-option shell# make clean shell# make However this only works on Linux build, may I ask when I want to build php mysqli using PHP SAK tools for windows following steps on this git post, what should I do to define MYSQLI_NO_CHANGE_USER_ON_PCONNECT to disable change user?

weltling commented 5 years ago

Thanks for the question. On the Windows side passing CFLAGS, LDFLAGS and others from the environment is not supported. Probably it's a good idea to implement it. This is actually not related to the PHP SDK, but to the PHP core. Could you please open a feature request on bugs.php.net and assign it to me?

This is also not exported as a configure as a configure option in PHP. For now what you can do is edit the Makefile manually to add tthis define.

Thanks.

xixibu commented 5 years ago

Hi Anatol, Thanks a lot for your reply, this helps a lot. I've opened a feature request https://bugs.php.net/bug.php?id=77230 to request this feature, but it seems I cannot assign it to you since I do not have a php.net account. Could you kindly pick it up and may I ask whether I can sign up an php.net account? Thanks & Best Regards

cmb69 commented 5 years ago

Okay, I'm closing this ticket in favor of https://bugs.php.net/77230.