Code Monkey home page Code Monkey logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
hi guys,

please include these patches.

thx

best regards,
David

Original comment by [email protected] on 28 Apr 2011 at 1:03

Attachments:

from php-amqplib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Thank you for your patches. I have partially commited them, but I have question 
about following parts:

-            $this->sock->close();
+            fclose($this->sock);

why fclose() is better than using close() method of sock?

And why you suggest to remove BufferedInput:

-            $this->sock = new BufferedInput($sock);
+            $this->sock = $sock;


Original comment by [email protected] on 30 Apr 2011 at 5:53

  • Changed state: Accepted

from php-amqplib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
applied these patches, stil I am getting this 



Notice: Object of class BufferedInput could not be converted to int in 
/var/www/php/lib/php-amqplib/amqp_wire.inc on line 263

Fatal error: Uncaught exception 'Exception' with message 'Error reading data. 
Recevived 0 instead of expected 1 bytes' in 
/var/www/php/lib/php-amqplib/amqp_wire.inc:319 Stack trace: #0 
/var/www/php/lib/php-amqplib/amqp_wire.inc(350): AMQPReader->rawread(1) #1 
/var/www/php/lib/php-amqplib/amqp.inc(494): AMQPReader->read_octet() #2 
/var/www/php/lib/php-amqplib/amqp.inc(514): AMQPConnection->wait_frame() #3 
/var/www/php/lib/php-amqplib/amqp.inc(166): AMQPConnection->wait_channel(0) #4 
/var/www/php/lib/php-amqplib/amqp.inc(251): AbstractChannel->next_frame() #5 
/var/www/php/lib/php-amqplib/amqp.inc(350): AbstractChannel->wait(Array) #6 
/var/www/php/send.php(5): AMQPConnection->__construct('localhost', 80, 'guest', 
'guest') #7 {main} thrown in /var/www/php/lib/php-amqplib/amqp_wire.inc on line 
319

Original comment by [email protected] on 22 Oct 2011 at 2:03

from php-amqplib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Same problem here.

Fatal error: Uncaught exception 'Exception' with message 'Error reading data. 
Recevived 0 instead of expected 1 bytes' in 
/home/me/public_html/include/mq/amqp_wire.inc:317
Stack trace:
#0 /home/me/public_html/include/mq/amqp_wire.inc(348): AMQPReader->rawread(1)
#1 /home/me/public_html/include/mq/amqp.inc(590): AMQPReader->read_octet()
#2 /home/me/public_html/include/mq/amqp.inc(610): AMQPConnection->wait_frame()
#3 /home/me/public_html/include/mq/amqp.inc(178): 
AMQPConnection->wait_channel(0)
#4 /home/me/public_html/include/mq/amqp.inc(282): AbstractChannel->next_frame()
#5 /home/me/public_html/include/mq/amqp.inc(652): AbstractChannel->wait(Array)
#6 /home/me/public_html/include/mq/amqp.inc(458): AMQPConnection->close()
#7 [internal function]: AMQPConnection->__destruct()
#8 {main}
  thrown in /home/me/public_html/include/mq/amqp_wire.inc on line 317

My environment:
PHP 5.3.6
rabbitmq-server-2.7.1-1.noarch.rpm
erlang.x86_64 R14B-03.3.el5

Original comment by [email protected] on 31 Jan 2012 at 3:27

from php-amqplib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
There were no changes from the first patch to apply and only a minimal set of 
changes from the second patch to apply.

Once done I then started receiving this error:
Fatal error: Call to a member function real_sock() on a non-object in 
/home/trustacq/public_html/include/mq/amqp_wire.inc on line 305

This is because you requested this change in the patch:
-            $this->sock = new BufferedInput($sock);
+            $this->sock = $sock;

So then I did a bit more investigation, your amqp_consumer.php and 
amqp_publisher.php examples were working ok for me so I then assumed it was an 
error in my own code.

But then I changed the username and password in the config.php and ran your 
examples again only to receive this error:

Fatal error: Uncaught exception 'Exception' with message 'Error reading data. 
Recevived 0 instead of expected 1 bytes' in /root/php-amqplib/amqp_wire.inc:317
Stack trace:
#0 /root/php-amqplib/amqp_wire.inc(348): AMQPReader->rawread(1)
#1 /root/php-amqplib/amqp.inc(590): AMQPReader->read_octet()
#2 /root/php-amqplib/amqp.inc(610): AMQPConnection->wait_frame()
#3 /root/php-amqplib/amqp.inc(178): AMQPConnection->wait_channel(0)
#4 /root/php-amqplib/amqp.inc(282): AbstractChannel->next_frame()
#5 /root/php-amqplib/amqp.inc(437): AbstractChannel->wait(Array)
#6 /root/php-amqplib/demo/amqp_publisher.php(9): 
AMQPConnection->__construct('localhost', 5672, 'guestrrr', 'guestrrr', '/')
#7 {main}
  thrown in /root/php-amqplib/amqp_wire.inc on line 317

So it looks like the patch doesn't need to be applied in the version I'm using
and the error is in fact an invalid username/password combination and nothing 
more than that.

Long story short: I changed my config.php to use username & password 
guest/guest for my own code and the error magically disappeared!


Original comment by [email protected] on 31 Jan 2012 at 3:46

from php-amqplib.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Here another approach.
Replaced (BufferedInput) $this->sock with (resouce) $this->sock->sock, and demo 
work for me.

Original comment by [email protected] on 12 Dec 2012 at 2:55

Attachments:

from php-amqplib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.