XMR does not work on custom install on Plesk / centos

I came across this on a CentOS install today actually.

The issue is that Plesk, Cpanel etc bring their own PHP installations with them, so when you’re running “php” on the command line, that’s not the same PHP as is being run when you call phpinfo(); from inside the webserver.

In addition, the command line version of PHP will have its own php.ini file in all likelihood.

So first, from the console on the server, see where the other installs of PHP are:

find / -type f -name php

You’ll likely find another PHP install somewhere either in /usr/local or somewhere else.

Run that php binary, with the -i option, and see if that lists zmq as enabled:

/usr/local/blah/php -i | grep zmq

If that outputs nothing, then run

/usr/local/blah/php -i | grep php.ini

to find out the location of the php.ini file it’s reading, and enable your zmq module there as well.

Then re-run the first check to see that zmq is now enabled.

Assuming it is, run XMR using that php rather than the system default php. As a side note, ‘localhost’ didn’t work for me on CentOS. I had to configure the private port for XMR to use tcp://127.0.0.1:50001 explicitly.