waltervl wrote: ↑Thursday 13 January 2022 19:26
I succeeded. I also updated the wiki with some instructions:
https://www.domoticz.com/wiki/Customization#PHP
The example is from the latest changes in Domoticz source code from @Lokonli
@Lokonli, what are the current restrictions for using the Domoticz webserver with php scripts? I see that Dashticz is served by an external webserver. You had your reasons I suppose.
I will reply from Dashticz perspective.
When we added server functionality to Dashticz at that time PHP was not working in Domoticz.
Later, I tried to fix PHP support in Domoticz. I partly succeeded. However, there are still a few issues:
* If login is activated in Domoticz, then the www path is only accessible after successful login. That means the Dashticz dashboard won't load when the login cookie expires.
* If I remember correctly passing of query parameters from Domoticz to PHP is not fully implemented.
* Return codes from PHP via Domoticz to the client doesn't work.
* I tried to build for Windows as well. Unfortunately I was not able to get that working. That means, I don't know whether PHP is working with Domoticz on Windows.
Some additional things to investigate:
* Dashticz may initiate quite some network requests via Domoticz. Impact on performance should be validated.
So, I started to explore other directions: node.js backend with react frontend
I've a first prototype working. However, it will be quite some work to port all Dashticz functionality. Currently, I've put this on hold.
Or, as alternative: Dashticz requires only very minimal backend functionality. In fact only proxy functionality is needed to bypass CORS issues. So, if we could initiate a network request via the Domoticz json interface, including setting of cookies, then we are almost done. Then for Dashticz we only need a login mechanism. That may require some changes in Domoticz, but that should be doable. This way we completely get rid of the PHP dependency for Dashticz which probably makes more sense than trying to add full PHP support to the Domoticz server.