Diagnostics for PHP coders

This script, "diagnostics.php", will help you find out the characteristics
of the PHP version on your server.

You can download it at: www.topcode.co.uk

Host IP

This server is located at: 109.203.99.158

PHP Version

PHP has come in various versions over the years and different hosts have
different versions installed. PHP commands can vary over time. The way
PHP is configured can vary, and sometimes the host can change the
configuration file.

On this server, the PHP version is: 5.6.30

So, what works and what doesn't?

Safe mode

On this server, safe_mode is is OFF.

More about safe_mode

Maximum execution time for scripts

On this server, the maximum script execution time for scripts is 30 seconds.

safe_mode is OFF, so you can change max_execution_time with either:

ini_set("max_execution_time", $seconds);

or

set_time_limit($seconds);

allow_url_fopen

On this server, allow_url_fopen is ON.

open_basedir

If open_basedir is ON, the files that can be opened by PHP are limited
to the specified directory-tree, including the file itself.

On this server, open_basedir is OFF.

simplexml_load_file();

On this server, allow_url_fopen is ON so

simplexml_load_file();

to an external domain will succeed, subject to the open_basedir setting.

file_get_contents();

On this server, allow_url_fopen is ON so

file_get_contents();

to an external domain will succeed, subject to the open_basedir setting..

Curl

Curl is a safe way to fetch content from other sites. It works
irrespective of the value of allow_url_open. However, PHP must be
configured so that curl routines are enabled.

On this server, curl is enabled.

CURLOPT_FOLLOWLOCATION

Just in case the url for your curl resource changes, curl has the
FOLLOWLOCATION option to automatically follow and retrieve the
requested data from its new location.

On this server, safe_mode is is OFF, so FOLLOWLOCATION should succeed. Use:

if (ini_get("safe_mode")) {
    < write code to parse the response >
  } else {
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
}

Disclaimer

This script has been prepared in good faith but no guarantee of
accuracy or suitablity for purpose is offered.

Last update: 25/07/13