📄 precheckup.php.svn-base
字号:
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 '<p><strong><font color="green">Your web server is set up to use the .htaccess files.</font></strong></p>'; } return '<p><strong><font color="orange">Your web server is NOT set up to use the .htaccess files.</font></strong></p>';}?><html> <head> <title><?php echo APP_NAME;?> Checkup</title> <style>th { text-align: left; }td { vertical-align: top; } </style> </head> <body><h1><?php echo APP_NAME;?> Checkup</h1><p>This checkup allows you to check that your environment is ready tosupport a <?php echo APP_NAME;?> installation, and that you can proceed toconfigure your system. Red items are things to fix. Orange items meansyou may not be having the ultimate experience unless the support isadded. Green items means you're ready to go in this area. You cancheck back here to see if anything has changed in your environment ifyou have any problems.</p><h2>.htaccess file</h2><p>You can let <?php echo APP_NAME;?> manage the PHP settings that apply to the<?php echo APP_NAME;?> application (it won't affect your other applications) byconfiguring your web server to use the .htaccess files that come with<?php echo APP_NAME;?>. This will ensure that the settings for <?php echo APP_NAME;?>(detailed below) are set up for optimal, reliable performance.</p><?php echo htaccess()?><?php$kturl = KTUtil::kt_url();?><h2>General KnowledgeTree</h2><table><tbody><tr><th width=400>KnowledgeTree Server Directory</td><td><?php echo KT_DIR;?></td></tr><tr><th>KnowledgeTree URL</td><td><?php echo $kturl;?></td></tr></tbody></table><h2>PHP version and extensions</h2><p>This relates to your PHP installation environment - which version ofPHP you are running, and which modules are available.</p><?php$extensions = array( 'session'=>'Session', 'mysql'=>'MySQL', 'mbstring'=>'Multi Byte String', 'curl'=>'cURL', 'exif'=>'Exif', 'sockets'=>'Sockets',);$optional_extensions = array( 'gettext'=>array('Gettext','Only needed for using non-English languages'), 'fileinfo'=>array('Fileinfo','Provides better file identification support - not necessary if you use file extensions'), 'win32service'=>array('Win32 Service','Allows Microsoft Windows services to be controlled. '), 'openssl'=>array('OpenSSL','Provides encryption support'));?><table width="100%"> <tbody> <tr> <th>PHP version 5 or above</th> <td><?php echo $phpversion5text?></td> </tr> <tr> <th>PHP version 5.2.2 or above</th> <td><?php echo $phpversion522text?></td> </tr> <tr> <th>PHP version below 6</th> <td><?php echo $phpversion6text?></td> </tr><?php foreach($extensions as $ext=>$name) {?> <tr> <th><?php echo $name?> support</th> <td><?php echo must_extension_loaded($ext);?></td> </tr><?php } foreach($optional_extensions as $ext=>$detail) { list($name, $desc) = $detail;?> <tr> <th><?php echo $name?> support</th> <td><?php echo can_extension_loaded($ext, $desc);?></td> </tr><?php }?> </tbody></table><h2>PHP configuration</h2><p>This relates to the configuration of PHP on your system.</p><h3>Recommended settings</h3><table width="50%"> <thead> <tr> <th>Configuration option</th> <th>Recommended value</th> <th>Current value</th> </tr> </thead> <tbody><?php echo boolSetting('Safe Mode','safe_mode','OFF')?><?php echo boolSetting('Display Errors','display_errors','ON', false, "Will be set correctly anyway.")?><?php echo boolSetting('Display Startup Errors','display_startup_errors','ON', false, "Will be set correctly anyway.")?><?php echo boolSetting('File Uploads','file_uploads','ON')?><?php echo boolSetting('Magic Quotes GPC','magic_quotes_gpc','OFF', false, "Quotes will be removed; not optimal")?><?php echo boolSetting('Magic Quotes Runtime','magic_quotes_runtime','OFF')?><?php echo boolSetting('Register Globals','register_globals','OFF', false, "Globals will be removed; not optimal, may be a security risk")?><?php echo boolSetting('Output Buffering','output_buffering','OFF')?><?php echo boolSetting('Session auto start','session.auto_start','OFF')?><?php echo emptySetting('Automatic prepend file','auto_prepend_file')?><?php echo emptySetting('Automatic append file','auto_append_file')?><?php echo emptySetting('Open base directory','open_basedir')?><?php echo stringSetting('Default MIME type', 'default_mimetype', 'text/html')?> </tbody></table><h3>Limits</h3><table width="50%"> <thead> <tr> <th>Configuration option</th> <th>Recommended value</th> <th>Current value</th> </tr> </thead> <tbody><?php echo bigEnough('Maximum POST size', 'post_max_size', 32 * 1024 * 1024, true)?><?php echo bigEnough('Maximum upload size', 'upload_max_filesize', 32 * 1024 * 1024, true, true, false, true)?><?php echo bigEnough('Memory limit', 'memory_limit', 32 * 1024 * 1024, true, true, false, true)?><?php echo ""; # bigEnough('Maximum execution time', 'max_execution_time', 30)?><?php echo ""; # bigEnough('Maximum input time', 'max_input_time', 60)?> <tbody></table><h3>Paths</h3><table width="50%"> <tbody> <tr> <td class="item"> Session save path </td> <td align="left"> <b><?php echo (($sp=ini_get('session.save_path'))?$sp:'Not set'); ?></b>, <?php echo is_writable( $sp ) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>';?> </td> </tr> <tr> <td class="item"> Upload temporary path </td> <td align="left"> <b><?php echo (($sp=ini_get('upload_tmp_dir'))?$sp:'Not set'); ?></b> <?php if ($sp) { echo ', ' . is_writable( $sp ) ? '<b><font color="green">Writeable</font></b>' : '<b><font color="red">Unwriteable</font></b>';} ?> </td> </tr> </tbody></table><h2>Filesystem</h2><table width="50%"> <tbody><?php$username = running_user();if (is_null($username)) { $message = "You are on a system that does not make user details available, and so no advice is possible on the correct ownership of the <b>log</b> and <b>Documents</b> directories.";} else { $message = APP_NAME.' will be run as the <b><font color="orange">' . $username . '</font></b> system user, and must be able to write to the <b>log</b> and <b>Documents</b> directories.';}?><tr><td width="33%">General</td><td><?php echo $message?></td></tr> </tbody></table><h2>Post-installation checkup</h2><p>Once you have installed, check the <a href="postcheckup.php">Post-installation checkup</a>.</p> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -