From 178c4659ebef16d92a8e21cb67938eaaaa9a01a1 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Tue, 12 Feb 2013 13:53:16 +0000 Subject: [PATCH] More config file debug hints git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329474 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/ini.xml | 14 ++++- reference/mysqlnd_ms/quickstart.xml | 3 +- reference/mysqlnd_ms/setup.xml | 87 +++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 2 deletions(-) diff --git a/reference/mysqlnd_ms/ini.xml b/reference/mysqlnd_ms/ini.xml index 4e844ce0b4..88ec785d89 100755 --- a/reference/mysqlnd_ms/ini.xml +++ b/reference/mysqlnd_ms/ini.xml @@ -97,7 +97,19 @@ This setting is not only useful to restrict PHP to certain servers but also - to debug configuration file problems. + 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. diff --git a/reference/mysqlnd_ms/quickstart.xml b/reference/mysqlnd_ms/quickstart.xml index 7699df8335..00da3b8a44 100755 --- a/reference/mysqlnd_ms/quickstart.xml +++ b/reference/mysqlnd_ms/quickstart.xml @@ -201,7 +201,8 @@ mysqlnd_ms.config_file=/path/to/mysqlnd_ms_plugin.ini errors may appear in some log files only. Further validation is done when a connection is to be established and the configuration file is searched for valid sections. Setting mysqlnd_ms.force_config_usage - may help debugging a faulty setup. + may help debugging a faulty setup. Please, see also + configuration file debugging notes. diff --git a/reference/mysqlnd_ms/setup.xml b/reference/mysqlnd_ms/setup.xml index cfd5ea1444..01105c407d 100755 --- a/reference/mysqlnd_ms/setup.xml +++ b/reference/mysqlnd_ms/setup.xml @@ -382,6 +382,93 @@ $mysqli = new mysqli("localhost", "username", "password", "database"); + + The validity of the configuration file is checked both when reading the + configuration file and later when establishing a connection. The configuration + file is read during PHP request startup. At this early stage a PHP extension + may not display error messages properly. In the worst case, no error + is shown and a connection attempt fails without an adequate error message. + This problem has been cured in version 1.5.0. + + + + Common error message in case of configuration file issues (upto version 1.5.0) + + +]]> + + &example.outputs; + + + + + + + Since version 1.5.0 startup errors are additionally buffered and emitted when + a connection attempt is made. Use the configuration directive + mysqlnd_ms.force_config_usage + to set the error type used to display buffered errors. By default an error + of type E_WARNING will be emitted. + + + + Improved configuration file validation since 1.5.0 + + +]]> + + &example.outputs; + + + + + + + It can be useful to set mysqlnd_ms.force_config_usage = 1 + when debugging potential configuration file errors. This will not only turn the + type of buffered startup errors into E_RECOVERABLE_ERROR but also + help detecting misspelled section names. + + + + Possibly more precise error due to <literal>mysqlnd_ms.force_config_usage=1</literal> + + + + + +]]> + +&example.outputs; + + + + + + Here is a short explanation of the configuration directives that can be used.