litespeedtech / litespeedtech/openlitespeed
Customised error pages for "error pages" = 500 does not work
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 233
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 5
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with /usr/local/lsws/Example/html/p.php, /error500.html, and the WebAdmin Customized Error Pages setting, then run the shown curl request against port 8088. Trace how the HTTP 500 response is generated and verify that the configured error500.html content is returned instead of an empty response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, ubuntu
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100