Notes by David Gibson (mostly for myself). See page footer for date
Apache Info | Server built: Apr 10 2025 15:26:09 | Sometimes this gives an Apache version number, but it might just give the server build date. from: echo exec('httpd -v'); |
Software | Apache | from: echo $_SERVER['SERVER_SOFTWARE']; |
Server Name | bcra.org.uk | from: echo $_SERVER['SERVER_NAME']; |
Located at | britiac4.british-caving.org.uk | from: echo gethostbyaddr($_SERVER['SERVER_ADDR']); |
Server Addr. | 31.25.186.126 | from: echo $_SERVER['SERVER_ADDR']; |
PHP Version | 5.6.40 | from: echo phpversion(); |
Remote Addr. | 3.139.240.192 | from: echo $_SERVER['REMOTE_ADDR']; |
This is BCRA's new site at britiac3.miniserver.com, also known as britiac4.british-caving.org.uk. This test page might be reachable in several different ways (e.g. via an add-on domain or a sub-domain, which maps to a sub-directory).
The use of a sub-domain or add-on domain can make things complicated because the hierarchy for parsing .htaccess files (for server directives) is not necessarily the same as the hierarchy for parsing .user.ini files (for PHP directives). The salient point is that, on britiac3, PHP directives cannot appear in .htaccess, but must be placed in .user.ini instead. Note to self: watch out for this where a sub-domain maps to a sub-directory of public_html.
The .user.ini file that I have provided for this test sets a PHP error log that is within the http document root (See force a run-time PHP error , below). If error_log is not specified then britiac3 defaults to error_log="error_log", which is a file in the current directory.
Britiac3 runs PHP in CGI mode (i.e. not as an Apache module), so you cannot use php_value or php_flag commands in a .htaccess file, else an 'internal server error' message will be generated. A per-directory .user.ini file can be used for PHP directives, or they can be run from PHP using the ini_set() function. See my demonstration files.
PHP status:
. ...and is PHP short tag working? "Yes"
If .html files are not parsing for PHP, try check_installation.php , which then loads
check_installation.html . This test is controlled by JS
embedded on this page.
PHP
initialisation: Has .user.ini been parsed? "89"
(Why?: This is a check whether .user.ini has set
max_execution_time = 89. This might not be the case if you have arrived via a sub-domain that
lands in a sub-directory of /home/public_html/ or if you are
running this at localhost.
max_execution_time | 89 | .htaccess sets this to 87 (Localhost). The .user.ini file sets it to 89. The system default is 90. |
default_charset | Windows-1252 | Added to set-up 15-Dec-2017. This should be Windows-1252 to prevent problems on localhost. See notes at https://caves.org.uk/charset_test.html |
auto_globals_jit | 1 | Should be 'true' |
allow_url_fopen | 1 | Should be 'true' |
magic_quotes_gpc | Should be 'false' or 'empty' | |
max_file_uploads | 20 | This is set at a system level. Watch out for problems on Hidden Earth Photo Salon page if it is not set high enough. |
date.timezone | Europe/London | The server might set this to 'UTC', but .user.ini should override that. |
session.save_path | /var/cpanel/php/sessions/ea-php56 | Just double-check that this path matches the PHP version that has been requested. |
error_log | /home/bcra/public_html/__error_logs/php_errors.log |
Are error documents handled correctly? Try to fetch a page that does not exist . (Why?: This is a check that .htaccess has been parsed correctly, and has processed my ErrorDocument directive to supply my404.html ). The reason for using a customised ErrorDocument is that it makes debugging easier when there are multiple sites running on the same public server. ErrorDocument for common errors should always be set, even if it is only to default.
Force a run-time PHP error and check that it is handled correctly, and logged to the correct location. (Why?: This is a check that .htaccess has been parsed correctly, and has written to the correct error log. NB: the error path must pre-exist - it is not created when first needed. See table above
Look at the page-last-modified date, below. It uses PHP's date('r') function, and the timezone should be +0100 during summer, provided that .user.ini or php.ini has executed to set the timezone. In fact, lets just do a check on that, via ini_get('date.timezone'). If Timezone is not reporting as "Europe/London" then this can be set in .user.ini. See table above.
Running phpinfo() will provide more information when required.
It is worth checking whether .htaccess files are correctly handling +indexes and -indexes , directives, because something further up the tree might be wrongly configured.
Check whether Basic Auth is working. Username: user1, Password: password1. Encrypted password, for pasting into passwd.txt , is {SHA}44rSFJQ9qtHWTBAvrsKd5K/p2j0=