Hi All,<div><br></div><div>I am trying to declare a queue in RabbitMQ with php.</div><div><br></div><div>Here is my code</div><div><br></div><div><div>function declareQueue($queue_name)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;queue = new AMQPQueue($this-&gt;channel); &nbsp; //channel is already created. am omitting that code from here</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;queue-&gt;setName($queue_name);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;queue-&gt;setFlags(AMQP_DURABLE);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;queue-&gt;setFlags(AMQP_PASSIVE);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;queue-&gt;declare();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></div><div><br></div><div><div>$amqp -&gt; declareQueue("myqueue");</div></div><div><br></div><div><br></div><div><br></div><div>This part of code is giving an error when there is no queue in RabbitMQ. the error is:</div><div><br></div><div><font color="#000000">PHP Fatal error: &nbsp;Uncaught exception 'AMQPQueueException' with message 'Server channel error: 404, message: NOT_FOUND - no queue 'myqueue' in vhost '/''</font><br></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Every thing is going fine when the queue is already created in Rabbitmq.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Any help please.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Thanks in advance.</font></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>