Runtime Configuration
The behaviour of these functions is affected by settings in php.ini.
Name | Default | Changeable | Changelog |
---|---|---|---|
mysqlnd_ms.enable | 0 | PHP_INI_SYSTEM | |
mysqlnd_ms.force_config_usage | 0 | PHP_INI_SYSTEM | |
mysqlnd_ms.ini_file | "" | PHP_INI_SYSTEM | |
mysqlnd_ms.config_file | "" | PHP_INI_SYSTEM | |
mysqlnd_ms.collect_statistics | 0 | PHP_INI_SYSTEM | |
mysqlnd_ms.multi_master | 0 | PHP_INI_SYSTEM | |
mysqlnd_ms.disable_rw_split | 0 | PHP_INI_SYSTEM |
Here's a short explanation of the configuration directives.
-
mysqlnd_ms.enable
integer -
Enables or disables the plugin. If disabled, the extension will not plug into mysqlnd to proxy internal mysqlnd C API calls.
-
mysqlnd_ms.force_config_usage
integer -
If enabled, the plugin checks if the host (server) parameters value of any MySQL connection attempt, matches a section name from the plugin configuration file. If not, the connection attempt is blocked.
This setting is not only useful to restrict PHP to certain servers but also to debug configuration file problems. The configuration file validity is checked at two different stages. The first check is performed when PHP begins to handle a web request. At this point the plugin reads and decodes the configuration file. Errors thrown at this early stage in an extensions life cycle may not be shown properly to the user. Thus, the plugin buffers the errors, if any, and additionally displays them when establishing a connection to MySQL. By default a buffered startup error will emit an error of type E_WARNING. If force_config_usage is set, the error type used is E_RECOVERABLE_ERROR.
Please, see also configuration file debugging notes.
-
mysqlnd_ms.ini_file
string -
Plugin specific configuration file. This setting has been renamed to mysqlnd_ms.config_file in version 1.4.0.
-
mysqlnd_ms.config_file
string -
Plugin specific configuration file. This setting superseeds mysqlnd_ms.ini_file since 1.4.0.
-
mysqlnd_ms.collect_statistics
integer -
Enables or disables the collection of statistics. The collection of statistics is disabled by default for performance reasons. Statistics are returned by the function mysqlnd_ms_get_stats().
-
mysqlnd_ms.multi_master
integer -
Enables or disables support of MySQL multi master replication setups. Please, see also supported clusters.
-
mysqlnd_ms.disable_rw_split
integer -
Enables or disables built-in read write splitting.
Controls whether load balancing and lazy connection functionality can be used independently of read write splitting. If read write splitting is disabled, only servers from the master list will be used for statement execution. All configured slave servers will be ignored.
The SQL hint MYSQLND_MS_USE_SLAVE will not be recognized. If found, the statement will be redirected to a master.
Disabling read write splitting impacts the return value of mysqlnd_ms_query_is_select(). The function will no longer propose query execution on slave servers.
Note: Multiple master servers
Setting mysqlnd_ms.multi_master=1 allows the plugin to use multiple master servers, instead of only the first master server of the master list.
Please, see also supported clusters.
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-mysqlnd-ms.configuration.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.