大部分的连接是OK的,操作一晚上大概出现两三次服务器500的错误,而且没有错误的信息.服务器环境 win2003 IIS6 PHP5.38 MYSQL5.5 YII1.8
在调试模式下记录了这一错误:
PHP Error
D:\www\root\YiiRoot\framework\db\CDbConnection.php(405)
393 * @since 1.0.4
394 */
395 protected function createPdoInstance()
396 {
397 $pdoClass=$this->pdoClass;
398 if(($pos=strpos($this->connectionString,’:’))!==false)
399 {
400 $driver=strtolower(substr($this->connectionString,0,$pos));
401 if($driver===‘mssql’ || $driver===‘dblib’ || $driver===‘sqlsrv’)
402 $pdoClass=‘CMssqlPdoAdapter’;
403 }
404 return new $pdoClass($this->connectionString,$this->username,
405 $this->password,$this->_attributes);
406 }
407
408 /**
409 * Initializes the open db connection.
410 * This method is invoked right after the db connection is established.
411 * The default implementation is to set the charset for MySQL and PostgreSQL database connections.
412 * @param PDO $pdo the PDO instance
413 */
414 protected function initConnection($pdo)
415 {
416 $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
417 if($this->emulatePrepare!==null && constant(‘PDO::ATTR_EMULATE_PREPARES’))
Stack Trace
#0 + D:\www\root\YiiRoot\framework\db\CDbConnection.php(405): PDO->__construct("mysql:host=localhost;dbname=yii_dn", "root", "password", array())
#1 + D:\www\root\YiiRoot\framework\db\CDbConnection.php(356): CDbConnection->createPdoInstance()
…
请教强哥和各位大神 这个应该从什么方向考虑? 怎么获取到错误的原因?