Viewing file: phpversion.php (10.73 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DWmail - System Tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p align="center"><img src="dwmail.jpg" alt="DWmail" width="216" height="55" /></p>
<p align="left" class="TableHeader"> <b>System Requirements Checker</b></p>
<?php
error_reporting(E_ALL ^ E_NOTICE);
function version_check($vercheck) {
$minver = explode(".", $vercheck);
$curver = explode(".", phpversion());
$versionfailure = 0;
if($curver[0] < $minver[0]) {
$versionfailure = 1;
}
if ($curver[1] < $minver[1] && ($curver[0] <= $minver[0]) && $versionfailure == 0) {
$versionfailure = 1;
}
if (substr($curver[2], 0, 1) < $minver[2] && ($curver[1] <= $minver[1]) && ($curver[0] <= $minver[0]) && $versionfailure == 0) {
$versionfailure = 1;
}
if ($versionfailure == 1) {
$versioncheck = "<span class=\"Fail\">Fail</span>";
}
else {
$versioncheck = "<span class=\"Success\">OK</span>";
}
return $versioncheck;
}
function check_trans_sid() {
ob_start();
phpinfo(INFO_GENERAL);
$val_phpinfo .= ob_get_contents();
ob_end_clean();
if (strstr($val_phpinfo, "--enable-trans-sid")) {
$sid_enabled = true;
}
else {
$sid_enabled = false;
}
return $sid_enabled;
}
$versioncheck = & version_check('4.1.0');
echo ("<table width=\"100%\"><tr><td valign=\"top\">");
echo ("<table><tr><td class=\"MainTitle\" colspan=\"2\">PHP Version Checker</td></tr>
<tr><td class=\"NavTable\">PHP Version (min 4.1.0) - " . phpversion() . "</td><td class=\"NavTable\">[$versioncheck]</td></tr>
<tr><td class=\"MainTitle\" colspan=\"2\">Minimum System Requirements</td></tr>");
$sid_enabled = true;
if ($versioncheck == '<span class=\"Success\">OK</span>') {
$sid_enabled = & check_trans_sid();
}
$phpext = get_loaded_extensions();
$allowbutton = 1;
echo ("<tr><td class=\"NavTable\">PHP IMAP Support</td><td class=\"NavTable\">[");
if (in_array ("imap", $phpext)){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Fail\">Fail</span>");
$allowbutton = 0;
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTable\">PHP Session Support</td><td class=\"NavTable\">[");
if (in_array ("session", $phpext)){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Fail\">Off</span>");
$allowbutton = 0;
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTable\">Perl Compatible Regular Expression (pcre) Support</td><td class=\"NavTable\">[");
if (in_array ("pcre", $phpext)){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"MainTitle\" colspan=\"2\">Database Support (calendar, addressbook, enhanced preferences)</td></tr>");
echo ("<tr><td class=\"NavTable\" colspan=\"2\"><em>Only one type necessary for database support but DWmail can use any of the three types below</em></td></tr>");
$dbsupported = 0;
echo ("<tr><td class=\"NavTable\">MySQL Database Support</td><td class=\"NavTable\">[");
if (in_array ("mysql", $phpext)){
echo ("<span class=\"Success\">OK</span>");
$dbsupported = 1;
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTable\">MySQLi Database Support (if using PHP5 <em>and</em> MySQL 4.1+)</td><td class=\"NavTable\">[");
if (in_array ("mysqli", $phpext)){
echo ("<span class=\"Success\">OK</span>");
$dbsupported = 1;
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTable\">PostgreSQL Database Support</td><td class=\"NavTable\">[");
if (in_array ("pgsql", $phpext)){
echo ("<span class=\"Success\">OK</span>");
$dbsupported = 1;
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
if ($allowbutton == 1 && $dbsupported == 1) {
echo ("<tr><td class=\"NavTableLT\" colspan=\"2\" align=\"center\">");
echo ("<span class=\"Success\">Your system appears to meet the minimum system requirements needed to run DWmail</span>");
echo ("</td></tr>");
}
else {
echo ("<tr><td class=\"NavTableLT\" colspan=\"2\" align=\"center\">");
echo ("<span class=\"Fail\">Your system does not appear to meet the minimum system requirements needed to run DWmail</span>");
echo ("</td></tr>");
}
echo ("<tr><td class=\"MainTitleLT\" colspan=\"2\">Recommended System Requirements</td></tr>");
echo ("<tr><td class=\"NavTableLT\" colspan=\"2\"><em>Recommended system requirements are optional but some functionality may not be available for each of the areas that fail (if any) below</em></td></tr>");
echo ("<tr><td class=\"NavTableLT\">Zlib Support (for dynamic zip file generation)</td><td class=\"NavTableLT\">[");
if (in_array ("zlib", $phpext)){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">PSpell Support (spell checker)</td><td class=\"NavTableLT\">[");
if (in_array ("pspell", $phpext)){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Warning\">Not Installed</span>");
}
echo ("]</td></tr>");
$transidenabled = ini_get('session.use_trans_sid');
echo ("<tr><td class=\"NavTableLT\">Session trans_sid setting</td><td class=\"NavTableLT\">[");
if (($transidenabled == 0) || ($sid_enabled == false)) {
echo ("<span class=\"Warning\">Disabled</span>");
}
else {
echo ("<span class=\"Success\">OK</span>");
}
echo ("]</td></tr>");
$fileuploadsupport = ini_get('file_uploads');
$filetempdir = ini_get('upload_tmp_dir');
$filemaxsize = ini_get('upload_max_filesize');
$postmaxsize = ini_get('post_max_size');
$memlimit = ini_get('memory_limit');
$fileopenbasedir = ini_get('open_basedir');
echo ("<tr><td class=\"NavTableLT\">Upload Support (sending attachments)</td><td class=\"NavTableLT\">[");
if ($fileuploadsupport == 1){
echo ("<span class=\"Success\">OK</span>");
}
else {
echo ("<span class=\"Warning\">Not Enabled</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"MainTitleLT\" colspan=\"2\">GD Image Generation</td></tr>");
echo ("<tr><td class=\"NavTableLT\" colspan=\"2\"><em>Optional functions to dynamically resize image attachments and generate CAPTCHA login authentication images</em></td></tr>");
echo ("<tr><td class=\"NavTableLT\">GD Support</td><td class=\"NavTableLT\">[");
if (!function_exists("imagecreate")){
echo ("<span class=\"Warning\">Disabled</span>");
}
else {
echo ("<span class=\"Success\">OK</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">GD Version (2.0 bundled or higher recommended)</td><td class=\"NavTableLT\">[");
$gdstuff = @gd_info();
echo ("<span>" . $gdstuff['GD Version'] . "</span>");
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Image generation support for file types</td><td class=\"NavTableLT\">[");
echo ("<span>");
if (@imagetypes() & IMG_JPG) {
echo ("JPEG, ");
}
if (@imagetypes() & IMG_GIF) {
echo ("GIF, ");
}
if (@imagetypes() & IMG_PNG) {
echo ("PNG, ");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Freetype 2 Text Support (for CAPTCHA type 2 support)</td><td class=\"NavTableLT\">[");
if (!function_exists("imageftbbox")){
echo ("<span class=\"Warning\">Disabled</span>");
}
else {
echo ("<span class=\"Success\">OK</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Flite support (audio CAPTCHA support) [looking for /usr/bin/flite]</td><td class=\"NavTableLT\">[");
if (!file_exists("/usr/bin/flite") || !function_exists("shell_exec")){
echo ("<span class=\"Warning\">Disabled</span>");
}
else {
echo ("<span class=\"Success\">OK</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Temporary Directory Writable './tmp' (needed for Flite and image resizing)</td><td class=\"NavTableLT\">[");
if (!is_writable("../tmp")){
echo ("<span class=\"Warning\">Disabled</span>");
}
else {
echo ("<span class=\"Success\">OK</span>");
}
echo ("]</td></tr>");
echo ("<tr><td class=\"MainTitleLT\" colspan=\"2\">Useful System Information</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Upload temporary directory</td><td class=\"NavTable\">[");
echo ("<span>");
if (isset($filetempdir)) {
echo ($filetempdir);
}
else {
echo (" ");
}
echo ("</span>");
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Maximum Upload File Size</td><td class=\"NavTableLT\">[");
echo ("<span>");
if (isset($filemaxsize)) {
echo ($filemaxsize);
}
else {
echo (" ");
}
echo ("</span>");
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Maximum POST Size</td><td class=\"NavTableLT\">[");
echo ("<span>");
if (isset($postmaxsize)) {
echo ($postmaxsize);
}
else {
echo (" ");
}
echo ("</span>");
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Memory Limit <a href=\"#memlimit\">(*)</a></td><td class=\"NavTableLT\">[");
echo ("<span>");
if (isset($memlimit)) {
echo ($memlimit);
}
else {
echo (" ");
}
echo ("</span>");
echo ("]</td></tr>");
echo ("<tr><td class=\"NavTableLT\">Open base directory</td><td class=\"NavTableLT\">[");
echo ("<span>");
if (isset($fileopenbasedir)) {
echo ($fileopenbasedir);
}
else {
echo ("Not Set");
}
echo ("</span>");
echo ("]</td></tr>");
echo ("</table>");
if ($allowbutton == 0) {
echo ("<p class=\"Fail\"><strong>One or more of the core system requirements failed in our tests</strong><br />This may be a false positive as our testing is only by what PHP tells us</p>");
}
echo ("<a name=\"memlimit\"></a><p><strong>*</strong> A note about memory limits. DWmail and the handling of large emails and attachments is governed by the PHP memory limit. DWmail can download single attachments at approximately 65-75% the size of the memory limit. The rest is taken up with overheads for the login, the rest of the email, etc. We cannot give accurate details as each email is different and thus it's memory resources are different in each case. The same principle applies to large mailboxes. Whilst we do not actually download the attachments when displaying a mailbox we do perform checks on each email, especially if filters are enabled. Very large emails or mailboxes may cause PHP to reach it's upper memory limit. See <a href="http://uk.php.net/manual/en/features.file-upload.common-pitfalls.php" target="_blank">PHP's website for more information</a></p>");
echo ("</td></tr></table>");
?>
</body>
</html>
|