jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [check.php] - Diff between revs 13 and 85

Show entire file Ignore whitespace

Rev 13 Rev 85
Line 29... Line 29...
$value = substr($line,$sep_pos+4); $value = substr($line,$sep_pos+4);
$php_general[$name] = $value; $php_general[$name] = $value;
} }
} }
   
$ini_file = $php_general['Configuration File (php.ini) Path']; $ini_file = $php_general['Loaded Configuration File'];
$extra_ini = php_ini_scanned_files(); $extra_ini = php_ini_scanned_files();
if($extra_ini != '') if($extra_ini != '')
{ $extra_ini = "The following additional ini files were read: $extra_ini"; } { $extra_ini = "The following additional ini files were read: $extra_ini"; }
else { $extra_ini = "There were no additional ini files, according to PHP."; } else { $extra_ini = "There were no additional ini files, according to PHP."; }
   
Line 50... Line 50...
$gdstring="This PHP uses the 'bundled' GD library, which doesn't have alpha-blending bugs. That's good!\n"; $gdstring="This PHP uses the 'bundled' GD library, which doesn't have alpha-blending bugs. That's good!\n";
} }
else else
{ {
$gdstring="This PHP uses the system GD library, which MIGHT have alpha-blending bugs. Check that you have at least GD 2.0.34 installed, if you see problems with weathermap segfaulting.\n"; $gdstring="This PHP uses the system GD library, which MIGHT have alpha-blending bugs. Check that you have at least GD 2.0.34 installed, if you see problems with weathermap segfaulting.\n";
  $gdstring .= "You can test for this specific fault by running check-gdbug.php\n";
} }
} }
else else
{ {
$gdstring = "The gdinfo() function is not available, which means that either the GD extension is not available, not enabled, or not installed.\n"; $gdstring = "The gdinfo() function is not available, which means that either the GD extension is not available, not enabled, or not installed.\n";
Line 70... Line 71...
print wordwrap("This is PHP Version $php_version running on \"$php_os\" with a memory_limit of '$mem_allowed'. $mem_warning\n"); print wordwrap("This is PHP Version $php_version running on \"$php_os\" with a memory_limit of '$mem_allowed'. $mem_warning\n");
print "\nThe php.ini file was $ini_file\n$extra_ini\n\n"; print "\nThe php.ini file was $ini_file\n$extra_ini\n\n";
print ""; print "";
print "PHP Functions\n-------------\n"; print "PHP Functions\n-------------\n";
print "Some parts of Weathermap need special support in your PHP\ninstallation to work.\n\n"; print "Some parts of Weathermap need special support in your PHP\ninstallation to work.\n\n";
print wordwrap($gdstring)."\n"; print wordwrap($gdstring)."\n";
} }
else else
{ {
$environment = "web"; $environment = "web";
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title>Weathermap Pre-Install Checker</title> <title>Weathermap Pre-Install Checker</title>
<style> <style type="text/css">
body { font-family: Lucida Grande,Arial,sans-serif; font-size: 10pt; } body { font-family: 'Lucida Grande',Arial,sans-serif; font-size: 10pt; }
p {margin-bottom: 10px; margin-top: 10px;} p {margin-bottom: 10px; margin-top: 10px;}
table { margin: 20px;} table { margin: 20px;}
.critical { width: 400px; padding: 10px; background: #fee; border: 1px solid #f88; padding-left: 20px; background-image: left no-repeat url(images/exclamation.png); } .critical { width: 400px; padding: 10px; background: #fee; border: 1px solid #f88; padding-left: 20px; background: left no-repeat url(images/exclamation.png); }
.noncritical { width: 400px; padding: 10px; background: #ffe; border: 1px solid #fb8; } .noncritical { width: 400px; padding: 10px; background: #ffe; border: 1px solid #fb8; }
.ok { width: 400px; padding: 10px; background: #efe; border: 1px solid #8f8; } .ok { width: 400px; padding: 10px; background: #efe; border: 1px solid #8f8; }
</style> </style>
</head> </head>
<body> <body>
   
<h1>Weathermap Pre-install Checker</h1> <h1>Weathermap Pre-install Checker</h1>
   
<p>This page checks for some common problems with your PHP and server environment that may stop Weathermap or the Editor from working.</p> <p>This page checks for some common problems with your PHP and server environment that may stop Weathermap or the Editor from working.</p>
<p>NOTE: You should run this script as a web page AND from the command-line, as the environment can be different in each.</p> <p>NOTE: You should run this script as a web page AND from the command-line, as the environment can be different in each.</p>
<h2>PHP Basics</h2><p>This is the PHP version that is responsible for<ul> <h2>PHP Basics</h2><p>This is the PHP version that is responsible for</p><ul>
<li>The web-based editor<li>Building maps with Rebuild Now from Cacti</ul></p> <li>The web-based editor</li><li>Building maps with Rebuild Now from Cacti</li></ul>
<p>This is PHP Version <?php echo $php_version ?> running on "<?php echo $php_os ?>" with a memory_limit of '<?php echo $mem_allowed ?>'. <?php echo $mem_warning ?></p> <p>This is PHP Version <?php echo $php_version ?> running on "<?php echo $php_os ?>" with a memory_limit of '<?php echo $mem_allowed ?>'. <?php echo $mem_warning ?></p>
<p>The php.ini file was <?php echo $ini_file ?></p> <p>The php.ini file was <?php echo $ini_file ?></p>
<p><?php echo $extra_ini ?></p> <p><?php echo $extra_ini ?></p>
<h2>PHP Functions</h2> <h2>PHP Functions</h2>
<p>Some parts of Weathermap need special support in your PHP installation to work.</p> <p>Some parts of Weathermap need special support in your PHP installation to work.</p>
Line 124... Line 125...
   
'imagecreatefromjpeg' => array(FALSE,FALSE,'JPEG input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), 'imagecreatefromjpeg' => array(FALSE,FALSE,'JPEG input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'),
'imagecreatefromgif' => array(FALSE,FALSE,'GIF input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'), 'imagecreatefromgif' => array(FALSE,FALSE,'GIF input support for ICON and BACKGROUND','an optional part of the GD library and the "gd" PHP extension'),
'imagejpeg' => array(FALSE,FALSE,'JPEG output support','an optional part of the GD library and the "gd" PHP extension'), 'imagejpeg' => array(FALSE,FALSE,'JPEG output support','an optional part of the GD library and the "gd" PHP extension'),
'imagegif' => array(FALSE,FALSE,'GIF output support','an optional part of the GD library and the "gd" PHP extension'), 'imagegif' => array(FALSE,FALSE,'GIF output support','an optional part of the GD library and the "gd" PHP extension'),
'imagecopyresampled' => array(FALSE,FALSE,'Thumbnail creation in the Cacti plugin','an optional part of the GD library and the "gd" PHP extension'), # 'imagefilter' => array(FALSE, FALSE, 'colorizing icons','a special function of the PHP-supplied GD library ONLY (not the external GD library'.($gdbuiltin?'':' that you are using').')'),
  'imagecopyresampled' => array(FALSE,FALSE,'Thumbnail creation in the Cacti plugin','an optional part of the GD library and the "gd" PHP extension'),
'imagettfbbox' => array(FALSE,FALSE,'TrueType font support','an optional part of the GD library and the "gd" PHP extension'), 'imagettfbbox' => array(FALSE,FALSE,'TrueType font support','an optional part of the GD library and the "gd" PHP extension'),
'memory_get_usage' => array(FALSE,TRUE,'memory-usage debugging','not supported on all PHP versions and platforms') 'memory_get_usage' => array(FALSE,TRUE,'memory-usage debugging','not supported on all PHP versions and platforms')
); );
   
$results=array(); $results=array();
Line 228... Line 230...
if($environment=="CLI") print "\n---------------------------------------------------------------------\n"; if($environment=="CLI") print "\n---------------------------------------------------------------------\n";
   
if($critical>0) if($critical>0)
{ {
if($environment=='web') print "<div class=\"critical\">"; if($environment=='web') print "<div class=\"critical\">";
print wordwrap("There are problems with your PHP or server environment that will stop Weathermap from working. You need to correct this issues if you wish to use Weathermap.\n"); print wordwrap("There are problems with your PHP or server environment that will stop Weathermap from working. You need to correct these issues if you wish to use Weathermap.\n");
if($environment=='web') print "</div>"; if($environment=='web') print "</div>";
} }
else else
{ {
if($noncritical>0) if($noncritical>0)
Line 273... Line 275...
} }
   
return $val; return $val;
} }
?> ?>
  </table>
  </body>
  </html>

Powered by WebSVN 2.2.1