Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Dbus stable implementation

Tags:

php

dbus

My situation:
I have a software composed of some compiled C++ daemons running in the background, a PHP/JS web interface and a CLI interface written in Python. Currently to send a Dbus command from PHP (web interface) to a daemon we use a python script to proxy the call, because python has a very mature Dbus implementation.

My Question:
There is any stable Dbus implementations to use withing PHP, compatible with Ubuntu Server/CentOs ?

What have I tried:
- The beta DBUS plugin in PECL that is not documented, still in beta, and complains about missing X11 envion (how is this good for servers ?).
- And then there is the GREE php-dbus extension that is not maintained, link to documentations redirects to a Japanese blog.

Thank you.

like image 418
Radu Maris Avatar asked Nov 01 '22 10:11

Radu Maris


1 Answers

PHP executed on a web server (like Apache) can't do D-Bus requests at all. I'm trying for several days without success. This is because the web server user (like www-data) can't access the dbus-daemon via a session connexion.

As a workaround I'm using the React built-in HTTP server. Exactly like you, but all in PHP. Your workaround is much more reliable.

like image 186
Epoc Avatar answered Nov 09 '22 14:11

Epoc