<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Runtime Configuration</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli.resources.html">Resource Types</a></div> <div class="up"><a href="mysqli.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="mysqli.configuration" class="section"> <h2 class="title">Runtime Configuration</h2> <p class="simpara"> The behaviour of these functions is affected by settings in <var class="filename">php.ini</var>. </p> <p class="para"> <table class="doctable table"> <caption><strong>MySQLi Configuration Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.allow-local-infile" class="link">mysqli.allow_local_infile</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.2.4.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.allow-persistent" class="link">mysqli.allow_persistent</a></td> <td>"1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.3.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.max-persistent" class="link">mysqli.max_persistent</a></td> <td>"-1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.3.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.max-links" class="link">mysqli.max_links</a></td> <td>"-1"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.default-port" class="link">mysqli.default_port</a></td> <td>"3306"</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.default-socket" class="link">mysqli.default_socket</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.default-host" class="link">mysqli.default_host</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.default-user" class="link">mysqli.default_user</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.default-pw" class="link">mysqli.default_pw</a></td> <td>NULL</td> <td>PHP_INI_ALL</td> <td>Available since PHP 5.0.0.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.reconnect" class="link">mysqli.reconnect</a></td> <td>"0"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 4.3.5.</td> </tr> <tr> <td><a href="mysqli.configuration.html#ini.mysqli.cache-size" class="link">mysqli.cache_size</a></td> <td>"2000"</td> <td>PHP_INI_SYSTEM</td> <td>Available since PHP 5.3.0.</td> </tr> </tbody> </table> </p> <p class="para"> For further details and definitions of the preceding PHP_INI_* constants, see the chapter on <a href="configuration.changes.html" class="link">configuration changes</a>. </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.mysqli.allow-local-infile"> <span class="term"> <em><code class="parameter">mysqli.allow_local_infile</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Allow accessing, from PHP's perspective, local files with LOAD DATA statements </p> </dd> </dt> <dt id="ini.mysqli.allow-persistent"> <span class="term"> <em><code class="parameter">mysqli.allow_persistent</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Enable the ability to create persistent connections using <span class="function"><a href="function.mysqli-connect.html" class="function">mysqli_connect()</a></span>. </p> </dd> </dt> <dt id="ini.mysqli.max-persistent"> <span class="term"> <em><code class="parameter">mysqli.max_persistent</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Maximum of persistent connections that can be made. Set to 0 for unlimited. </p> </dd> </dt> <dt id="ini.mysqli.max-links"> <span class="term"> <em><code class="parameter">mysqli.max_links</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> The maximum number of MySQL connections per process. </p> </dd> </dt> <dt id="ini.mysqli.default-port"> <span class="term"> <em><code class="parameter">mysqli.default_port</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> The default TCP port number to use when connecting to the database server if no other port is specified. If no default is specified, the port will be obtained from the <em>MYSQL_TCP_PORT</em> environment variable, the <em>mysql-tcp</em> entry in <var class="filename">/etc/services</var> or the compile-time <em>MYSQL_PORT</em> constant, in that order. Win32 will only use the <em>MYSQL_PORT</em> constant. </p> </dd> </dt> <dt id="ini.mysqli.default-socket"> <span class="term"> <em><code class="parameter">mysqli.default_socket</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The default socket name to use when connecting to a local database server if no other socket name is specified. </p> </dd> </dt> <dt id="ini.mysqli.default-host"> <span class="term"> <em><code class="parameter">mysqli.default_host</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The default server host to use when connecting to the database server if no other host is specified. Doesn't apply in <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe mode</a>. </p> </dd> </dt> <dt id="ini.mysqli.default-user"> <span class="term"> <em><code class="parameter">mysqli.default_user</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The default user name to use when connecting to the database server if no other name is specified. Doesn't apply in <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe mode</a>. </p> </dd> </dt> <dt id="ini.mysqli.default-pw"> <span class="term"> <em><code class="parameter">mysqli.default_pw</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The default password to use when connecting to the database server if no other password is specified. Doesn't apply in <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe mode</a>. </p> </dd> </dt> <dt id="ini.mysqli.reconnect"> <span class="term"> <em><code class="parameter">mysqli.reconnect</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Automatically reconnect if the connection was lost. </p> </dd> </dt> <dt id="ini.mysqli.cache-size"> <span class="term"> <em><code class="parameter">mysqli.cache_size</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Available only with <a href="book.mysqlnd.html" class="link">mysqlnd</a>. </p> </dd> </dt> </dl> </p> <p class="para"> Users cannot set <em>MYSQL_OPT_READ_TIMEOUT</em> through an API call or runtime configuration setting. Note that if it were possible there would be differences between how <em>libmysqlclient</em> and streams would interpret the value of <em>MYSQL_OPT_READ_TIMEOUT</em>. </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli.resources.html">Resource Types</a></div> <div class="up"><a href="mysqli.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>