Welcome! Log In Create A New Profile

Advanced

How to use php file as an errorpage?

Posted by Vopletti 
How to use php file as an errorpage?
August 25, 2015 08:39AM
I currently have custom html as an errorpage, but would like to use php.

Errorpages are configured in /etc/nginx/sites-enabled/mysite.com.conf

Apparently just changing
error_page 50x = /errorfiles/error50x.html;
to
error_page 50x = /errorfiles/error50x.php;
doesn't work.

What should I do to make my php errorpage work?

The reason I want to do this is that I want to send an email to myself when error 50x happens. Flooding my emailbox is not an issue here.
Re: How to use php file as an errorpage?
August 25, 2015 10:22AM
There where a php file is suppose to be run you need to tell nginx to do so (fast_cgi).

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready