litespeedtech / openlitespeed

Our high-performance, lightweight, open source HTTP server
https://openlitespeed.org
1.11k stars 188 forks source link

Customised error pages for "error pages" = 500 does not work #280

Open fizista opened 2 years ago

fizista commented 2 years ago

I tried setting up my own error page for the HTTP 500 error thrown by PHP. And it didn't work.

Steps on how to check it: 1) Install OLS on Ubuntu 20.04 according to the manual. 2) cp /usr/local/lsws/Example/html/phpinfo.php /usr/local/lsws/Example/html/p.php 3) Edit /usr/local/lsws/Example/html/p.php

\\phpinfo();
phpinfo():

4) cp /usr/local/lsws/Example/html/error404.html /usr/local/lsws/Example/html/error500.html 5) WebAdmin > Virtual Host Example > General > Customized Error Pages add "500 Internal Server Error" -> /error500.html 6) Restart Server 7) run curl -v http://localhost:8088/p.php

*   Trying ::1:8088...
* TCP_NODELAY set
* connect to ::1 port 8088 failed: Połączenie odrzucone
*   Trying 127.0.0.1:8088...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8088 (#0)
> GET /p.php HTTP/1.1
> Host: localhost:8088
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< content-type: text/html; charset=UTF-8
< content-length: 0
< date: Sat, 13 Nov 2021 06:08:54 GMT
< server: LiteSpeed
< connection: Keep-Alive
< 
* Connection #0 to host localhost left intact

As you can see, it does not load the prepared page with the error.

orddie commented 7 months ago

bump. getting this in 1.7.18