Yar Error Yar_client_protocol_exception

Source: Internet
Author: User
According to the Bird Brother blog Yar introduction, writing examples, reported yar_client_protocol_exception error, Google and Baidu have not found a solution, do you know the heroes?

yarserver.php

class API {    public function hello ($param = '')    {        return $param;    }    protected function hello2 ()    {    }}$service = new Yar_Server(new API());$service->handle();

yarclient.php


  
   SetOpt(YAR_OPT_CONNECT_TIMEOUT, 1000);//Set packager to JSON$client->SetOpt(YAR_OPT_PACKAGER, "json");$result = $client->hello('zhangsan');

Error details

Warning: [Debug Yar_Client 15:48:0.982003]: 2204859703: call api 'hello' at (r)'http://yar.demo.com/yarServer.php' with '1' parameters in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10Warning: [Debug Yar_Client 15:48:0.982082]: 2204859703: pack request by 'JSON', result len '53', content: '{"i":2204859703,"m":"hello","p":' in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10Fatal error: Uncaught exception 'Yar_Client_Protocol_Exception' with message 'malformed response header 'Warning: [Debug Yar_Server 15:4'' in /home/liuruntao/YarRPC-Demo/public/yarClient.php:10Stack trace:#0 /home/liuruntao/YarRPC-Demo/public/yarClient.php(10): Yar_Client->__call('hello', Array)#1 /home/liuruntao/YarRPC-Demo/public/yarClient.php(10): Yar_Client->hello('zhangsan')#2 {main}  thrown in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10

Reply content:

According to the Bird Brother blog Yar introduction, writing examples, reported yar_client_protocol_exception error, Google and Baidu have not found a solution, do you know the heroes?

yarserver.php

class API {    public function hello ($param = '')    {        return $param;    }    protected function hello2 ()    {    }}$service = new Yar_Server(new API());$service->handle();

yarclient.php


  
   SetOpt(YAR_OPT_CONNECT_TIMEOUT, 1000);//Set packager to JSON$client->SetOpt(YAR_OPT_PACKAGER, "json");$result = $client->hello('zhangsan');

Error details

Warning: [Debug Yar_Client 15:48:0.982003]: 2204859703: call api 'hello' at (r)'http://yar.demo.com/yarServer.php' with '1' parameters in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10Warning: [Debug Yar_Client 15:48:0.982082]: 2204859703: pack request by 'JSON', result len '53', content: '{"i":2204859703,"m":"hello","p":' in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10Fatal error: Uncaught exception 'Yar_Client_Protocol_Exception' with message 'malformed response header 'Warning: [Debug Yar_Server 15:4'' in /home/liuruntao/YarRPC-Demo/public/yarClient.php:10Stack trace:#0 /home/liuruntao/YarRPC-Demo/public/yarClient.php(10): Yar_Client->__call('hello', Array)#1 /home/liuruntao/YarRPC-Demo/public/yarClient.php(10): Yar_Client->hello('zhangsan')#2 {main}  thrown in /home/liuruntao/YarRPC-Demo/public/yarClient.php on line 10

The cause of the error has been found, as long as the Yar debug function can be turned off!

vim php.iniyar.debug=0 ;或者注释掉

This is can solve the above problem, landlord whether know why will report this warning, why?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.