corvus-ch / rabbitmq-cli-consumer

Consume RabbitMQ messages into any cli program
MIT License
236 stars 36 forks source link

Getting Error: fork/exec index.php: permission denied #53

Closed rnkhouse closed 5 years ago

rnkhouse commented 5 years ago

I am running this consumer command in linux:

./rabbitmq-cli-consumer --verbose --url amqp://user:password@xx.xx.xx.xx --queue-name transaction --executable 'index.php rabbitmq_consume rabbitmq_pull' --strict-exit-code

Error:

2019/01/09 20:37:45 Connecting RabbitMQ...
2019/01/09 20:37:45 Connected.
2019/01/09 20:37:45 Opening channel...
2019/01/09 20:37:45 Done.
2019/01/09 20:37:45 Setting QoS...
2019/01/09 20:37:45 Succeeded setting QoS.
2019/01/09 20:37:45 Declaring queue "transaction"...
2019/01/09 20:37:45 Registering consumer...
2019/01/09 20:37:45 Succeeded registering consumer.
2019/01/09 20:37:45 Waiting for messages...
2019/01/09 20:37:45 Processing message...
2019/01/09 20:37:45 Failed. Check error log for details.
2019/01/09 20:37:45 Error: fork/exec index.php: permission denied
2019/01/09 20:37:45 Failed:
2019/01/09 20:37:45 Processed!
2019/01/09 20:37:45 failed to aknowledge message: unexpected exit code 1
corvus-ch commented 5 years ago

My first guess would the that index.php does not have the executable flag set. This can be handled by setting the executable flat (chmod +x index.php) or by setting the --executable as php index.php or /usr/bin/php index.php (or whatever your absolute path to the php executable is).

rnkhouse commented 5 years ago

Worked with php index.php Thanks!