downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

リソース型> <インストール手順
[edit] Last updated: Fri, 17 May 2013

view this page in

実行時設定

php.ini の設定により動作が変化します。

MS SQL Server 設定オプション
名前 デフォルト 変更可能 変更履歴
mssql.allow_persistent "1" PHP_INI_SYSTEM  
mssql.max_persistent "-1" PHP_INI_SYSTEM  
mssql.max_links "-1" PHP_INI_SYSTEM  
mssql.min_error_severity "10" PHP_INI_ALL  
mssql.min_message_severity "10" PHP_INI_ALL  
mssql.compatability_mode "0" PHP_INI_ALL  
mssql.connect_timeout "5" PHP_INI_ALL  
mssql.timeout "60" PHP_INI_ALL PHP 4.1.0 以降で使用可能です。
mssql.textsize "-1" PHP_INI_ALL  
mssql.textlimit "-1" PHP_INI_ALL  
mssql.batchsize "0" PHP_INI_ALL PHP 4.0.4 以降で使用可能です。
mssql.datetimeconvert "1" PHP_INI_ALL PHP 4.2.0 以降で使用可能です。
mssql.secure_connection "0" PHP_INI_SYSTEM PHP 4.3.0 以降で使用可能です。
mssql.max_procs "-1" PHP_INI_ALL PHP 4.3.0 以降で使用可能です。
mssql.charset "" PHP_INI_ALL PHP 5.1.2 以降で、FreeTDS 7.0 以降を用いてビルドした場合に使用可能です。
PHP_INI_* モードの詳細および定義については どこで設定を行うのか を参照してください。



リソース型> <インストール手順
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes 実行時設定 - [5 notes]
up
0
pigochu at gmail dot com
1 year ago
If mssql.charset = "UTF-8" can't get UTF-8 string , u can use putenv() to set FREETDSCONF dynamic.
up
0
Brendon Crawford
3 years ago
Use this to check the runtime tds version...

<?php
/**
 *
 * Checks runtime tds version for freetds with mssql
 *
 * @author Brendon Crawford
 * @see http://us.php.net/manual/en/mssql.configuration.php
 * @param string $dbHost
 * @param int $dbPort
 * @param string $dbUser
 * @param string $dbPass
 * @return float
 *
 */
function checkTdsVersion($dbHost, $dbPort, $dbUser, $dbPass) {
   
$cmd = sprintf(
       
'echo "version" | ' .
       
"   tsql " .
       
"       -H '%s' " .
       
"       -p '%s' " .
       
"       -U '%s' " .
       
"       -P '%s' " .
       
"       -o q | " .
       
"cut -d ' ' -f4 ",
       
escapeshellarg($dbHost),
       
escapeshellarg($dbPort),
       
escapeshellarg($dbUser),
       
escapeshellarg($dbPass)
    );
   
$ver = (float)shell_exec($cmd);
    return
$ver;
}
?>
up
0
jakub dot otrzasek at marol dot com dot pl
3 years ago
mssql.charset      ""      PHP_INI_ALL
this setting is case sensitive, it can provide problms with connection to DB.

 ini_set('mssql.charset', 'utf-8');
this setting this allowed me to connect.

 ini_set('mssql.charset', 'UTF-8');
that one is ok.

regards!
up
0
ed at x-space dot net
4 years ago
Take care about mssql.max_procs = '-1'. It doesn't mean unlimited procs.

With the default driver, it's mean 25 procs.

See php.ini for more information.

If you're application is stress, mssql_connect may failed without adjustment.
up
0
valli at icsurselva dot ch
4 years ago
There also exists a configuration option called 'mssql.charset'.
It will override the 'client charset' setting in freetds.conf.
AFAIK this will only take effect if the 'tds version' setting
in freetds.conf is >=7.0

 
show source | credits | sitemap | contact | advertising | mirror sites