Skip to content

Commit

Permalink
updated with info on testhttperror.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmot committed May 28, 2022
1 parent ac34a7b commit ef73f03
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ But that problem is easily fixed. Like Linux, Windows has the ability to create

### Testing

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

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

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.

#### Additional Testing

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 -

```php
<?php
// this script is for testing ./errpages/httperror.php, just
// change the code below
$testcode = 401;
// this just proves we can overwrite $_SERVER
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
// get the code to httperror.php...
putenv("REDIRECT_STATUS={$testcode}");
// test!
require_once './errpages/httperror.php';
?>
```

Just change `$testcode` to the error code you want to test. Then point your browser to `testhttperror.php`.

### Folder Junctions

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.
Expand Down Expand Up @@ -106,7 +127,7 @@ ErrorDocument 405 /tests/httperror/errpages/httperror.php

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

## Live
## It Lives!

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.

Expand Down

0 comments on commit ef73f03

Please sign in to comment.