[PHP-users 35589] Re: PHP 5.3.6からのmysql_connect()が遅い

Etsuo SUMIYA sumiya-e @ ube-shinko.co.jp
2011年 5月 31日 (火) 14:20:19 JST


sumiyaといいます。

From: Etsuo SUMIYA <sumiya-e @ ube-shinko.co.jp>
Subject: [PHP-users 35588] PHP 5.3.6からのmysql_connect()が遅い
Date: Tue, 31 May 2011 14:07:26 +0900 (LMT)
Message-ID: <20110531.140726.01372912.sumiya-e @ ube-shinko.co.jp>

> sumiyaといいます。
> 
> 以下の環境で、PHPからのmysqlの接続が遅く調べております。原因として
> 思い当たるところがありましたら、教えていただきたいのですが。
> 
> Windows server  2008 SP2(IIS)
> PHP-5.3.6-nts-Win32-VC9-x86.zip
> mysql-noinstall-5.1.56-win32.zip
> PHPはfast-cgiで組み込んでいます。
> 

http://php.net/manual/en/function.mysql-connect.php
に以下の記述があり、localhostを127.0.0.1に変更したところ、速くなり
ました。もう少し、調べれば良かったです。お騒がせしました。

Whenever you specify "localhost" or "localhost:port" as server,
the MySQL client library will override this and try to connect to
a local socket (named pipe on Windows). If you want to use TCP/IP,
use "127.0.0.1" instead of "localhost". If the MySQL client
library tries to connect to the wrong local socket, you should set
the correct path as in your PHP configuration and leave the server
field blank. 


PHP-users メーリングリストの案内