Problems enabling PHP

Post Reply
josvink66
Posts: 4
Joined: Monday 08 January 2018 16:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Problems enabling PHP

Post by josvink66 » Wednesday 10 January 2018 17:18

Hello,

I'm trying to enable PHP with the Domoticz webserver. But it's not working.
I've read that you need to supply the argument to the php cgi.

I've installed php7.0 and php7.0-cgi. I've changed the /etc/init.d/domitcz.sh to include the path to php:
DEAMON_ARGS="$DEAMON_ARGS -php_cgi_path /usr/bin/php7.0-cgi"
But when i put a php file in the www folder i get: 501 Not Implemented
I've also try't it with php5, same effect.

Any idea's?

Greetings,
Jos Vink

User avatar
Egregius
Posts: 2691
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Problems enabling PHP

Post by Egregius » Wednesday 10 January 2018 17:23

I would suggest running Apache2, lighttpd, Nginx... besides domoticz.

josvink66
Posts: 4
Joined: Monday 08 January 2018 16:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Problems enabling PHP

Post by josvink66 » Wednesday 10 January 2018 18:02

Egregius wrote:
Wednesday 10 January 2018 17:23
I would suggest running Apache2, lighttpd, Nginx... besides domoticz.

Yes i was looking for that, but the page https://www.domoticz.com/wiki/Secure_Nginx_Proxy_Setup has no info anymore..
I've set up the webserver and php and set the documentfolder to /home/pi/domoticz/www but that did not work.

Do you know if there is any (working) tutorial out there?

User avatar
Egregius
Posts: 2691
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Problems enabling PHP

Post by Egregius » Wednesday 10 January 2018 18:23

It should be as simple as apt-get install apache2 I think.
Why would you use the same www folder? You can perfectly use a different folder.
Only downside of this way is that you'll have 2 port numbers.
In my case that's no problem because I only use the Apache web interface, the domoticz gui only for adding new devices.

josvink66
Posts: 4
Joined: Monday 08 January 2018 16:35
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Problems enabling PHP

Post by josvink66 » Wednesday 10 January 2018 18:25

My first idea was to run all of domoticz and the php scripts from the webserver.
But i'm gonne run it side by side now.

Thanks

User avatar
Egregius
Posts: 2691
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Problems enabling PHP

Post by Egregius » Wednesday 10 January 2018 18:29

If you only use php for scripts that shouldn't be an issue.
If you also like to have pages available in a browser you need to consider which ports you gonna use.
I only use my php floorplan as a front gui, so I didn't need to make that decision ;)

User avatar
DewGew
Posts: 237
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi
Domoticz version: V4.9741
Location: Sweden
Contact:

Re: Problems enabling PHP

Post by DewGew » Friday 02 February 2018 11:32

Help needed. I installed php5-cgi.
When i try to open my php file I get error '404 Not found'.
Raspberry Pi 2B - domoticz - Aeon Labs Z-Stick GEN5 - RFlink gateway
NanoPi NEO-air - domoticz - REGO6XX interface
Dashticz V2 - Homebridge

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest