Re: Pass2PHP
Posted: Saturday 04 May 2019 12:00
all .php files have root:rootEgregius wrote: ↑Saturday 04 May 2019 12:36 I don't understand...
Values in mysql table are updated, that means that pass2php is working.
If the lg function doesn't work it either doesn't have rights to the logfile or the parameters are wrong. In any way the apache or php logfile should show the errors.
Code: Select all
[code]127.0.1.1:80 127.0.0.1 - - [04/May/2019:12:59:38 +0200] "POST /secure/pass2php.php HTTP/1.1" 200 163 "-" "curl/7.52.1"
127.0.1.1:80 127.0.0.1 - - [04/May/2019:12:59:38 +0200] "POST /secure/pass2php.php HTTP/1.1" 200 149 "-" "curl/7.52.1"
127.0.1.1:80 127.0.0.1 - - [04/May/2019:12:59:38 +0200] "POST /secure/pass2php.php HTTP/1.1" 200 163 "-" "curl/7.52.1"
Code: Select all
-rwxrwxrwx 1 root root 318951 mei 4 13:03 domoticz.log
Code: Select all
php _fetchdomoticz.php
Code: Select all
<?php
if($status=='On'){
sw('Bijkeuken','On');
ok, this sounds odd bu there is no domoticz.log in /var/logEgregius wrote: ↑Saturday 04 May 2019 13:57 Test that apache can write to the logfile, and that the path to the logfile is correct in the lg function.
Add a lg(‘test’); line at the end of pass2php.
If the test is logged (remember to use tail to watch the logfile, not the domoticz gui).
Move the lg test line inside the device script.
Once that is working move the lg test line inside the if status is on brackets.
Or add diferent lg lines so you can see in the logfile where the script gets.
Seems like a 'rights" issue. As _fetch is working just add an lg('test'); in there and look at Apache log as well.. tail -f ****Apache.logTrigun wrote:ok, this sounds odd bu there is no domoticz.log in /var/logEgregius wrote: ↑Saturday 04 May 2019 13:57 Test that apache can write to the logfile, and that the path to the logfile is correct in the lg function.
Add a lg(‘test’); line at the end of pass2php.
If the test is logged (remember to use tail to watch the logfile, not the domoticz gui).
Move the lg test line inside the device script.
Once that is working move the lg test line inside the if status is on brackets.
Or add diferent lg lines so you can see in the logfile where the script gets.
ok, i did a full search with winscp but no apache.log or domoticz.log is foundsincze wrote: ↑Saturday 04 May 2019 21:08Seems like a 'rights" issue. As _fetch is working just add an lg('test'); in there and look at Apache log as well.. tail -f ****Apache.logTrigun wrote:ok, this sounds odd bu there is no domoticz.log in /var/logEgregius wrote: ↑Saturday 04 May 2019 13:57 Test that apache can write to the logfile, and that the path to the logfile is correct in the lg function.
Add a lg(‘test’); line at the end of pass2php.
If the test is logged (remember to use tail to watch the logfile, not the domoticz gui).
Move the lg test line inside the device script.
Once that is working move the lg test line inside the if status is on brackets.
Or add diferent lg lines so you can see in the logfile where the script gets.
Sent from my ONEPLUS A6003 using Tapatalk
Normally Apache should have some logging.Trigun wrote:could it be that /etc/init.d/domoticz.txt is the correct logfile?
yess I got something and it does show some errorssincze wrote: ↑Saturday 04 May 2019 22:20Normally Apache should have some logging.Trigun wrote:could it be that /etc/init.d/domoticz.txt is the correct logfile?
/var/log/apache2/access.log
/var/log/apache2/error.log
Is Apache running??
The lg command now in @egregiius code create a separate logfile. I modified it a bit so it shows up in the Domoticz log
Sent from my ONEPLUS A6003 using Tapatalk
ok, i did a chmod 777 on /var/log. now the error is gone.Trigun wrote: ↑Saturday 04 May 2019 22:22yess I got something and it does show some errorssincze wrote: ↑Saturday 04 May 2019 22:20Normally Apache should have some logging.Trigun wrote:could it be that /etc/init.d/domoticz.txt is the correct logfile?
/var/log/apache2/access.log
/var/log/apache2/error.log
Is Apache running??
The lg command now in @egregiius code create a separate logfile. I modified it a bit so it shows up in the Domoticz log
Sent from my ONEPLUS A6003 using Tapatalk
2019-05-04 22_20_00-_var_log_apache2_error.log - Domoticz-NEW! - Editor - WinSCP.png
now when I trigger the motion sensor i get the following error. apperantly something is wrong with the scriptTrigun wrote: ↑Saturday 04 May 2019 22:39ok, i did a chmod 777 on /var/log. now the error is gone.Trigun wrote: ↑Saturday 04 May 2019 22:22yess I got something and it does show some errorssincze wrote: ↑Saturday 04 May 2019 22:20 Normally Apache should have some logging.
/var/log/apache2/access.log
/var/log/apache2/error.log
Is Apache running??
The lg command now in @egregiius code create a separate logfile. I modified it a bit so it shows up in the Domoticz log
Sent from my ONEPLUS A6003 using Tapatalk
2019-05-04 22_20_00-_var_log_apache2_error.log - Domoticz-NEW! - Editor - WinSCP.png
i did a tail -f on the apache error log
since i set a lg (‘test’) on the pass2php.php file i can the test line in the apache log
Trigun wrote:now when I trigger the motion sensor i get the error that something is wrong in line 3 apperantly something is wrong with the scriptbut I dont know what?
Whaaaa great it works!!!sincze wrote:This website can check your php code and save you a lot of trouble
https://phpcodechecker.com
Sent from my ONEPLUS A6003 using Tapatalk