我使用workerman Thrift Rpc框架,在Handler文件中實(shí)現(xiàn)接口方法的時(shí)候,想連mysql查詢一下數(shù)據(jù)的時(shí)候報(bào)下面錯(cuò),如果不連接mysql就沒有問題,不知道為什么
PHP Fatal error: Uncaught exception 'Thrift\Exception\TTransportException' with message 'TSocket read 0 bytes' in \workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Transport\TSocket.php:269
Stack trace:
#0 \workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Transport\TTransport.php(74): Thrift\Transport\TSocket->read(4)
#1 \rpcdemo\workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Transport\TBufferedTransport.php(113): Thrift\Transport\TTransport->readAll(4)
#2 \workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Protocol\TBinaryProtocol.php(306): Thrift\Transport\TBufferedTransport->readAll(4)
#3 \workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Protocol\TBinaryProtocol.php(197): Thrift\Protocol\TBinaryProtocol->readI32(NULL)
#4 \workerman-thrift-master\Applications\ThriftRpc\Services\Account\Account.php(92): Thrift\Protocol\TBinaryProtocol->readMessage in D:\AcmCoder\user\rpcdemo\workerman-thrift-master\Applications\ThriftRpc\Lib\Thrift\Transport\TSocket.php on line 269
代碼就是很簡(jiǎn)單的一句連一下mysql
$mysqli = new mysqli($dbhost,$dbuser,$dbpass,$dbname);