Skip to content

Commit ef73f03

Browse files
committed
updated with info on testhttperror.php
1 parent ac34a7b commit ef73f03

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ But that problem is easily fixed. Like Linux, Windows has the ability to create
4141

4242
### Testing
4343

44-
At the top of `httperror.php` you find this -
44+
At the top of `/errpages/httperror.php` you find this -
4545

4646
```php
4747
// uncomment for testing
@@ -50,6 +50,27 @@ define('_DEBUG', false);
5050

5151
Change `false` to `true` and "debug" will be active. You can then load the page from the server and a `404` error will be simulated.
5252

53+
#### Additional Testing
54+
55+
The `/testhttperror.php` file can be used for testing error codes. First set `_DEBUG` to `false` in `/errpages/httperror.php`, and then open `/testhttperror.php` in your edtior -
56+
57+
```php
58+
<?php
59+
// this script is for testing ./errpages/httperror.php, just
60+
// change the code below
61+
$testcode = 401;
62+
// this just proves we can overwrite $_SERVER
63+
$_SERVER['HTTPS'] = 'on';
64+
$_SERVER['SERVER_PORT'] = 443;
65+
// get the code to httperror.php...
66+
putenv("REDIRECT_STATUS={$testcode}");
67+
// test!
68+
require_once './errpages/httperror.php';
69+
?>
70+
```
71+
72+
Just change `$testcode` to the error code you want to test. Then point your browser to `testhttperror.php`.
73+
5374
### Folder Junctions
5475

5576
You might be familiar with a Linux *hard link*. The Window's equivalent is a *junction*. And they are particularly useful when keeping project folders organized in separate and possibly unrelated locations but you want to serve them with XAMPP(*or MAMP*) during development.
@@ -106,7 +127,7 @@ ErrorDocument 405 /tests/httperror/errpages/httperror.php
106127

107128
This part `/tests/httperror` will need editing depending on how you set up the local server.
108129

109-
## Live
130+
## It Lives!
110131

111132
Most internet web servers have a *common* location for website files. It's typically located at `/home/$USER/public_html`. Where **`$USER`** is the *user* that owns the `public_html` folder. Depending on your server's particular configuration that folder may be named differently or in a different location.
112133

0 commit comments

Comments
 (0)