XMR does not work on custom install on Plesk / centos

Hello,

I try to make XMR work, but I can not do it.

I am on a custom installation (v1.8.6) on a server with plesk onyx on centos7

I have installed zeromq, the cms seems to throw the request to the display (which tells me that the problem does not come from zeromq) but XMR does not seem to work. I added the config.json file, the parameters in the cms look good.

But I can not run the command php xmr.phar, I have an error message:

PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:') in phar:///var/www/xxxxxxx-my-path-xxxxxx/vendor/xibosignage/xibo-xmr/bin/xmr.phar/index.php on line 15

and necessarily, display side: XMR Status : Disconnected

Can someone help me…

PS: sorry for my english, i’m french, i try to translate as much as i can

You’re running it from the wrong location - vendor/bin/xmr.phar is the correct place to run it from. Make sure your config.json file is in that same location and then try starting it from there.

Of course you will need some way to start that same comment during boot.

Thank you very much for your help

i have the same issue :

PHP Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='.:') in phar:///var/www/xxxx-my-path-xxxxxxxx/vendor/bin/xmr.phar/index.php on line 15

Very strange indeed - I can’t seem to recreate that problem here - the point of us distributing a PHAR file is that all of the vendor requirements are built into the phar.

I wonder if that message means that PHAR isn’t supported by your PHP installation.

Can you create a file with <?php phpinfo(); ?> in it to see if PHAR is supported?

here is the link to the file :
https://xibo.groupe-adf.net/phpinfo.php

a little UP :wink:
Would anyone have a little track to help me …

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.

first: a big thank you for your help

when i do a :
find / -type f -name php

he answers me :
/usr/bin/php
/opt/plesk/php/7.1/bin/php

so after :
/usr/bin/php -i | grep zmq

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/zmq.so' - /usr/lib64/php/modules/zmq.so: cannot open shared object file: No such file or directory in Unknown on line 0
/etc/php.d/zmq.ini

and

/opt/plesk/php/7.1/bin/php -i | grep zmq

/opt/plesk/php/7.1/etc/php.d/zmq.ini
zmq
libzmq version => 4.2.3

from there, I am a little lost and I do not know what I should do, if you could give me a little help …

It’s exactly as I wrote above. Plesk has brought its own version of PHP.

You need to use that to execute XMR.

So instead of

php xmr.phar

You instead need to run

/opt/plesk/php/7.1/bin/php xmr.phar

It’s exactly reasons like this we suggest a Docker based install, as these Cpanel/Plesk like systems make it extremely hard to understand what’s going on, and I suspect you’ll find that when you next apply security updates to Plesk, Xibo will stop working and you’ll need to make the same changes over again.

I will try to put myself in Docker but I do not master it yet …

On the other hand I would be happy to manage to make run this installation on Plesk anyway:

But even trying to run the xmr.phar file with the good version of PHP (Plesk’s), I have the same error:

I do not know if I did the right thing, but I did:
cd /var/www/xxxxxxx-my-path-xxxxxxx/vendor/bin
/opt/plesk/php/7.1/bin/php xmr.phar

Failed opening required 'vendor/autoload.php' (include_path='.:/opt/plesk/php/7.1/share/pear') in phar:///var/www/xxxxxxx-my-path-xxxxxxx/vendor/bin/xmr.phar/index.php on line 15

I don’t know then I’m afraid. That’s what worked for me.

If someone is intresseted i did find a solution to run XMR with plesk on Centos 7.

Here is mine xiboxmr.service:

[Unit]
Description=“Xibo XMR Message Relay”
StartLimitBurst=20
StartLimitIntervalSec=5

[Service]
Type=simple
User={the systemuser of the subscription}
WorkingDirectory=/var/www/vhosts/{path to xibo}/ #make sure this is the root of xibo.
ExecStart=/opt/plesk/php/7.1/bin/php /var/www/vhosts/{path to xibo}/vendor/bin/xmr.phar
Restart=on-failure

[Install]
WantedBy=multi-user.target

Thank you for share.

One question, i have my service pointed to one installation of xibo, running well.

If I make a second Installation (diferent doman, same server VPS), will have to create a second service pointing to xmr.phar of the second installation or the service of the first is enough to handle all?

One installation of XMR can service multiple CMS instances. You don’t need to install a new one for each CMS.

1 Like