Comments (6)
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.
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.
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.
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.
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.
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)
- AMQPReader::rawread goes into an infinite loop on premature EOF HOT 9
- value too big exception from bytesplit HOT 3
- Caught exception: Error reading data. HOT 3
- basic_consume() throws an exception after 5 secs. HOT 5
- Exception thrown when publishing a message with body = the digit zero.
- Undefined variable: METHOD_NAME_MAP HOT 2
- tx_commit not supported HOT 1
- Bug in AMQPDecimal::asBCvalue HOT 1
- Patch to fix PHP Notices present on PHP 5.3.2 with r28 (+ support for multiple rabbit servers)
- amqp_test.php errors HOT 1
- typo in amqplib/amqp_wire.inc HOT 2
- [double fclose] fclose(): 121 is not a valid stream resource in [/full/path/to/amqplib/amqp.inc] on line 467
- Missing a break statement in dump_table function
- trap for bcmatch installed is missed
- Expecting AMQP method, received frame type: 3 HOT 1
- fwrite infinite loop - diff provided to fix issue HOT 4
- Exceptions on desctrutor HOT 1
- [patch] Remove global variable from amqp.inc
- how to set heartbeat to keep connection alive?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-amqplib.