Welcome,
Guest
.
Please
login
or
register
.
Did you miss your
activation email
?
News:
Convert
Wordpress to Elxis
with
Elxis importer
!
Home
Help
Login
Register
Elxis CMS Forum
»
Support
»
Security
»
Possible to receive email notification of syntax error?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Possible to receive email notification of syntax error? (Read 6171 times)
seadhna
Hero Member
Posts: 509
Possible to receive email notification of syntax error?
«
on:
August 16, 2021, 14:01:08 »
Hi, our website was down a couple of days ago but we did not receive an alert from the service we use: Uptime Robot.
The error message displayed for anyone visiting the site was:
Parse error: syntax error, unexpected end of file, expecting ')' in /home/example/public_html/example/logs/defender_ban.php on line 85
Could you advise, what type of error this is classed as? Database error? And is there a way to receive a notification via email from Elxis when it has happened?
Logged
datahell
Elxis Team
Hero Member
Posts: 10358
Re: Possible to receive email notification of syntax error?
«
Reply #1 on:
August 17, 2021, 19:30:29 »
This is from Defender's log file which couldn't close properly and generated a PHP error. Due to this error the whole site generated a php error so an e-mail could not be sent.
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
seadhna
Hero Member
Posts: 509
Re: Possible to receive email notification of syntax error?
«
Reply #2 on:
August 18, 2021, 14:02:14 »
Thanks datahell,
a solution to ensure an alert is received from UptimeRobot for this type of error is to add a "Keyword Exists" monitor for the keyword: syntax (which likely will not appear on the site as regular content) or there is also a "Keyword Does Not Exist" alert which notifies if a word disappears from the source code.
Logged
datahell
Elxis Team
Hero Member
Posts: 10358
Re: Possible to receive email notification of syntax error?
«
Reply #3 on:
August 18, 2021, 19:04:50 »
A monitoring service, like uptime robot, usually checks if the web server is online or not. It doesn't check the site's content. The web server will set a "200" status in headers in both cases. So, you cannot distinguish if there is a php error or not with this method.
See attached screenshot
. However this can be solved but as this problem is very rare I think it doesn't worth the effort.
«
Last Edit: August 18, 2021, 19:19:35 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
datahell
Elxis Team
Hero Member
Posts: 10358
Re: Possible to receive email notification of syntax error?
«
Reply #4 on:
August 18, 2021, 19:27:33 »
A different approach/tip.
You can take advantage of the Elxis "
heart beat
" or
generic AJAX
features. If Elxis doesn't reply properly to these requests then it doesn't work properly.
Elxis administration
(you must be logged in)
https://www.example.com/estia/beat
Elxis replies you with the
current time
in the form of UNIX
timestamp
.
Elxis frontend
(take advantage of the generix AJAX call)
https://www.example.com/ajax
Elxis replies you with the word
BAD
because the request part is missing but you know that the site is working properly.
If you don't get the "
BAD
" response then the site has problem
. You can test this in any Elxis site.
«
Last Edit: August 18, 2021, 19:30:51 by datahell
»
Logged
Elxis Team
|
Is Open Source
|
IOS Rentals | IOS AERO
seadhna
Hero Member
Posts: 509
Re: Possible to receive email notification of syntax error?
«
Reply #5 on:
August 20, 2021, 16:32:14 »
Yes, you are correct that is the way the standard monitor with Uptime Robot works, but they also have a keyword monitor where you get alerted if a particular word appears or disappears. However, this solution you provide is even more precise. Thanks!
Logged
Print
Pages: [
1
]
« previous
next »
Elxis CMS Forum
»
Support
»
Security
»
Possible to receive email notification of syntax error?