I
I
icell762021-10-02 21:40:37
PHP
icell76, 2021-10-02 21:40:37

How to make an automatic restart on error on a php site?

Hello. On my site, I periodically get a critical error "fatal error: Cannot access property Response::$headers in", which blocks the entire site.

What I want. Cron should check the site every, let's say 5 minutes. If it checks, it detects this error, it must restart the php service. Does anyone know how to do this or is there a ready made solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HexUserHex, 2021-10-02
@HexUserHex

Most likely you need to create a bash script that will periodically pull your cron that will check the presence of this error in the web server logs, and if it is present then restart your web server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question