Konstantin Shamko
Konstantin Shamko

Reputation: 63

HTTP connection resets after calling die() or exit() somewhere after RPC AMQP call

I have some kind of internal API which works with a DB and I'm doing calls to this API via AMQP. And when I do a synchronous (RPC) call and after that trying to redirect then HTTP connection resets. I'm redirecting like this:

header("Location: some_url"); die;

And I've found that the problem is in die() function. So I'm using PHP5.3, Apache2, RabbitMQ as AMQP broker. Also I'm using this extension http://pecl.php.net/package/amqp to work with AMQP. This is very confusing because if I remove die() everything is fine with the connection. But it's impossible to remove it because PHP: Utilizing exit(); or die(); after header("Location: ");

I will really appreciate if somebody can give me clue. Thanks

Upvotes: 0

Views: 141

Answers (1)

metalfight - user868766
metalfight - user868766

Reputation: 2750

Try to call flush() before die().

Upvotes: 0

Related Questions