| %s (%s) | %s | ', $name, $setting, $preferred);
if ($current == $preferred) {
$ret .= sprintf('%s', $current);
} else {
if ($red === true) {
$ret .= sprintf('%s', $current);
} else {
$ret .= sprintf('%s', $current);
}
if ($message) {
$ret .= ' (' . $message . ')';
}
}
$ret .= " | \n";
return $ret;
}
function stringSetting($name, $setting, $preferred, $red = true, $message = "") {
$current = ini_get($setting);
$ret = sprintf('| %s (%s) | %s | ', $name, $setting, $preferred);
if ($current == $preferred) {
$ret .= sprintf('%s', $current);
} else {
if ($red === true) {
$ret .= sprintf('%s', $current);
} else {
$ret .= sprintf('%s', $current);
}
if ($message) {
$ret .= ' (' . $message . ')';
}
}
$ret .= " |
\n";
return $ret;
}
function emptySetting($name, $setting) {
$current = ini_get($setting);
$ret = sprintf('| %s (%s) | unset | ', $name, $setting);
if (($current === false) or ($current === "")) {
$ret .= sprintf('unset');
} else {
$ret .= sprintf('Set: %s', $current);
}
$ret .= " |
\n";
return $ret;
}
function writablePath($name, $path) {
$ret = sprintf('| %s (%s) | ', $name, $path);
if (is_writable('../' . $path)) {
$ret .= sprintf('Writeable');
} else {
$ret .= sprintf('Unwriteable');
}
return $ret;
}
function prettySizeToActualSize($pretty) {
if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'G') {
return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024 * 1024;
}
if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'M') {
return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024;
}
if (strtoupper(substr($pretty, strlen($pretty) - 1)) == 'K') {
return (int)substr($pretty, 0, strlen($pretty)) * 1024 * 1024;
}
return (int)$pretty;
}
function prettySize($v) {
$v = (float)$v;
foreach (array('B', 'K', 'M', 'G') as $unit) {
if ($v < 1024) {
return $v . $unit;
}
$v = $v / 1024;
}
}
function get_php_int_setting($val) {
$r = ini_get($val);
if ($r === false) {
return $r;
}
return prettySizeToActualSize($r);
}
function bigEnough($name, $setting, $preferred, $bytes = false, $red = true, $zero_ok = false, $minusone_ok = false) {
$current = get_php_int_setting($setting);
if ($bytes === true) {
$ret = sprintf(' |
| %s (%s) | %s | ', $name, $setting, prettySize($preferred));
} else {
$ret = sprintf(' |
| %s (%s) | %s | ', $name, $setting, $preferred);
}
if ($current === false) {
$ret .= 'unset';
} else if ($current >= $preferred) {
if ($bytes === true) {
$ret .= sprintf('%s', prettySize($current));
} else {
$ret .= sprintf('%s', $current);
}
} else if (($current == 0) && ($zero_ok)) {
$ret .= sprintf('unlimited (%s)', $current);
} else if (($current == -1) && ($minusone_ok)) {
$ret .= sprintf('unlimited (%s)', $current);
} else {
if ($bytes === true) {
$ret .= sprintf('%s', prettySize($current));
} else {
$ret .= sprintf('%s', $current);
}
}
$ret .= " |
\n";
return $ret;
}
function haveExtension($ext) {
if (extension_loaded($ext)) {
return true;
}
// According to PEAR.php:
// if either returns true dl() will produce a FATAL error, stop that
if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
return false;
}
$libfileext = '.so';
$libraryprefix = '';
if (substr(PHP_OS, 0, 3) == "WIN") {
$libfileext = '.dll';
$libraryprefix = 'php_';
}
@dl(sprintf("%s%s%s", $libraryprefix, $ext, $libfileext));
return extension_loaded($ext);
}
function must_extension_loaded($ext, $message = "") {
if (haveExtension($ext)) {
return 'Available';
}
if ($message) {
return 'Unavailable (' . $message . ')';
}
return 'Unavailable';
}
function can_extension_loaded($ext, $message = "") {
if (haveExtension($ext)) {
return 'Available';
}
if ($message) {
return 'Unavailable (' . $message . ')';
}
return 'Unavailable';
}
$phpversion4 = phpversion() < '4' ? 'No (You need at least PHP 4)' : 'Yes';
$phpversion43 = phpversion() < '4.3' ? 'No (PHP 4.3 is recommended)' : 'Yes';
$phpversion5 = phpversion() >= '5' ? 'No ('.APP_NAME.' does not yet work with PHP5)' : 'Yes';
function running_user() {
if (substr(PHP_OS, 0, 3) == "WIN") {
return null;
}
if (extension_loaded("posix")) {
$uid = posix_getuid();
$userdetails = posix_getpwuid($uid);
return $userdetails['name'];
}
if (file_exists('/usr/bin/whoami')) {
return exec('/usr/bin/whoami');
}
if (file_exists('/usr/bin/id')) {
return exec('/usr/bin/id -nu');
}
return null;
}
function htaccess() {
if (array_key_exists('kt_htaccess_worked', $_SERVER)) {
return 'Your web server is set up to use the .htaccess files.
';
}
return 'Your web server is NOT set up to use the .htaccess files.
';
}
?>
Checkup
Checkup
This checkup allows you to check that your environment is ready to
support a installation, and that you can proceed to
configure your system. Red items are things to fix. Orange items means
you may not be having the ultimate experience unless the support is
added. Green items means you're ready to go in this area. You can
check back here to see if anything has changed in your environment if
you have any problems.
.htaccess file
You can let manage the PHP settings that apply to the
application (it won't affect your other applications) by
configuring your web server to use the .htaccess files that come with
. This will ensure that the settings for
(detailed below) are set up for optimal, reliable performance.
PHP version and extensions
This relates to your PHP installation environment - which version of
PHP you are running, and which modules are available.
| PHP version 4.0 or above |
|
| PHP version 4.3 or above |
|
| PHP version below 5 |
|
| Session support |
|
| MySQL support |
|
| Gettext support |
|
| Fileinfo support |
|
PHP configuration
This relates to the configuration of PHP on your system.
Recommended settings
| Configuration option |
Recommended value |
Current value |
Limits
| Configuration option |
Recommended value |
Current value |
Paths
|
Session save path
|
,
Writeable' : 'Unwriteable';?>
|
|
Upload temporary path
|
Writeable' : 'Unwriteable';} ?>
|
Filesystem
log and Documents directories.";
} else {
$message = APP_NAME.' will be run as the ' . $username . ' system user, and must be able to write to the log and Documents directories.';
}
?>
| General |
|
Post-installation checkup
Once you have installed, check the Post-installation checkup.