install.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. //we check first short tags if not we can not even load the installer
  3. if (! ((bool) ini_get('short_open_tag')) )
  4. die('<strong><u>KO7 Installation requirement</u></strong>: Before you proceed with your KO7 installation: Keep in mind KO7 uses the short tag "short cut" syntax.<br><br> Thus the <a href="http://php.net/manual/ini.core.php#ini.short-open-tag" target="_blank">short_open_tag</a> directive must be enabled in your php.ini.<br><br><u>Easy Solution</u>:<ol><li>Open php.ini file and look for line short_open_tag = Off</li><li>Replace it with short_open_tag = On</li><li>Restart then your PHP server</li><li>Refresh this page to resume your KO7 installation</li><li>Enjoy KO7 ;)</li></ol>');
  5. if (version_compare(PHP_VERSION, '5.3', '<'))
  6. {
  7. // Clear out the cache to prevent errors. This typically happens on Windows/FastCGI.
  8. clearstatcache();
  9. }
  10. else
  11. {
  12. // Clearing the realpath() cache is only possible PHP 5.3+
  13. clearstatcache(TRUE);
  14. }
  15. ?>
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  17. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  21. <title>Koseven Installation</title>
  22. <style type="text/css">
  23. body { width: 42em; margin: 0 auto; font-family: sans-serif; background: #fff; font-size: 1em; }
  24. h1 { letter-spacing: -0.04em; }
  25. h1 + p { margin: 0 0 2em; color: #333; font-size: 90%; font-style: italic; }
  26. code { font-family: monaco, monospace; }
  27. table { border-collapse: collapse; width: 100%; }
  28. table th,
  29. table td { padding: 0.4em; text-align: left; vertical-align: top; }
  30. table th { width: 12em; font-weight: normal; }
  31. table tr:nth-child(odd) { background: #eee; }
  32. table td.pass { color: #191; }
  33. table td.fail { color: #911; }
  34. #results { padding: 0.8em; color: #fff; font-size: 1.5em; }
  35. #results.pass { background: #191; }
  36. #results.fail { background: #911; }
  37. </style>
  38. </head>
  39. <body>
  40. <h1>Environment Tests</h1>
  41. <p>
  42. The following tests have been run to determine if Koseven will work in your environment.
  43. If any of the tests have failed, consult the <a href="https://docs.koseven.ga/guide/kohana/install">documentation</a>
  44. for more information on how to correct the problem.
  45. </p>
  46. <?php $failed = FALSE ?>
  47. <table cellspacing="0">
  48. <tr>
  49. <th>PHP Version</th>
  50. <?php if (version_compare(PHP_VERSION, '7', '>=')): ?>
  51. <td class="pass"><?php echo PHP_VERSION ?></td>
  52. <?php else: $failed = TRUE ?>
  53. <td class="fail">Koseven requires PHP 7 or newer, this version is <?php echo PHP_VERSION ?>.</td>
  54. <?php endif ?>
  55. </tr>
  56. <tr>
  57. <th>System Directory</th>
  58. <?php if (is_dir(SYSPATH) AND is_file(SYSPATH.'classes/Kohana'.EXT)): ?>
  59. <td class="pass"><?php echo SYSPATH ?></td>
  60. <?php else: $failed = TRUE ?>
  61. <td class="fail">The configured <code>system</code> directory does not exist or does not contain required files.</td>
  62. <?php endif ?>
  63. </tr>
  64. <tr>
  65. <th>Application Directory</th>
  66. <?php if (is_dir(APPPATH) AND is_file(APPPATH.'bootstrap'.EXT)): ?>
  67. <td class="pass"><?php echo APPPATH ?></td>
  68. <?php else: $failed = TRUE ?>
  69. <td class="fail">The configured <code>application</code> directory does not exist or does not contain required files.</td>
  70. <?php endif ?>
  71. </tr>
  72. <tr>
  73. <th>Cache Directory</th>
  74. <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'cache') AND is_writable(APPPATH.'cache')): ?>
  75. <td class="pass"><?php echo APPPATH.'cache/' ?></td>
  76. <?php else: $failed = TRUE ?>
  77. <td class="fail">The <code><?php echo APPPATH.'cache/' ?></code> directory is not writable.</td>
  78. <?php endif ?>
  79. </tr>
  80. <tr>
  81. <th>Logs Directory</th>
  82. <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'logs') AND is_writable(APPPATH.'logs')): ?>
  83. <td class="pass"><?php echo APPPATH.'logs/' ?></td>
  84. <?php else: $failed = TRUE ?>
  85. <td class="fail">The <code><?php echo APPPATH.'logs/' ?></code> directory is not writable.</td>
  86. <?php endif ?>
  87. </tr>
  88. <tr>
  89. <th>PCRE UTF-8</th>
  90. <?php if ( ! @preg_match('/^.$/u', 'ñ')): $failed = TRUE ?>
  91. <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with UTF-8 support.</td>
  92. <?php elseif ( ! @preg_match('/^\pL$/u', 'ñ')): $failed = TRUE ?>
  93. <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with Unicode property support.</td>
  94. <?php else: ?>
  95. <td class="pass">Pass</td>
  96. <?php endif ?>
  97. </tr>
  98. <tr>
  99. <th>SPL Enabled</th>
  100. <?php if (function_exists('spl_autoload_register')): ?>
  101. <td class="pass">Pass</td>
  102. <?php else: $failed = TRUE ?>
  103. <td class="fail">PHP <a href="http://www.php.net/spl">SPL</a> is either not loaded or not compiled in.</td>
  104. <?php endif ?>
  105. </tr>
  106. <tr>
  107. <th>Reflection Enabled</th>
  108. <?php if (class_exists('ReflectionClass')): ?>
  109. <td class="pass">Pass</td>
  110. <?php else: $failed = TRUE ?>
  111. <td class="fail">PHP <a href="http://www.php.net/reflection">reflection</a> is either not loaded or not compiled in.</td>
  112. <?php endif ?>
  113. </tr>
  114. <tr>
  115. <th>Filters Enabled</th>
  116. <?php if (function_exists('filter_list')): ?>
  117. <td class="pass">Pass</td>
  118. <?php else: $failed = TRUE ?>
  119. <td class="fail">The <a href="http://www.php.net/filter">filter</a> extension is either not loaded or not compiled in.</td>
  120. <?php endif ?>
  121. </tr>
  122. <tr>
  123. <th>Iconv Extension Loaded</th>
  124. <?php if (extension_loaded('iconv')): ?>
  125. <td class="pass">Pass</td>
  126. <?php else: $failed = TRUE ?>
  127. <td class="fail">The <a href="http://php.net/iconv">iconv</a> extension is not loaded.</td>
  128. <?php endif ?>
  129. </tr>
  130. <?php if (extension_loaded('mbstring')): ?>
  131. <tr>
  132. <th>Mbstring Not Overloaded</th>
  133. <?php if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING): $failed = TRUE ?>
  134. <td class="fail">The <a href="http://php.net/mbstring">mbstring</a> extension is overloading PHP's native string functions.</td>
  135. <?php else: ?>
  136. <td class="pass">Pass</td>
  137. <?php endif ?>
  138. </tr>
  139. <?php endif ?>
  140. <tr>
  141. <th>Character Type (CTYPE) Extension</th>
  142. <?php if ( ! function_exists('ctype_digit')): $failed = TRUE ?>
  143. <td class="fail">The <a href="http://php.net/ctype">ctype</a> extension is not enabled.</td>
  144. <?php else: ?>
  145. <td class="pass">Pass</td>
  146. <?php endif ?>
  147. </tr>
  148. <tr>
  149. <th>URI Determination</th>
  150. <?php if (isset($_SERVER['REQUEST_URI']) OR isset($_SERVER['PHP_SELF']) OR isset($_SERVER['PATH_INFO'])): ?>
  151. <td class="pass">Pass</td>
  152. <?php else: $failed = TRUE ?>
  153. <td class="fail">Neither <code>$_SERVER['REQUEST_URI']</code>, <code>$_SERVER['PHP_SELF']</code>, or <code>$_SERVER['PATH_INFO']</code> is available.</td>
  154. <?php endif ?>
  155. </tr>
  156. </table>
  157. <?php if ($failed === TRUE): ?>
  158. <p id="results" class="fail">✘ Koseven may not work correctly with your environment.</p>
  159. <?php else: ?>
  160. <p id="results" class="pass">✔ Your environment passed all requirements.<br />
  161. Remove or rename the <code>install<?php echo EXT ?></code> file now.</p>
  162. <?php endif ?>
  163. <h1>Optional Tests</h1>
  164. <p>
  165. The following extensions are not required to run the Koseven core, but if enabled can provide access to additional classes.
  166. </p>
  167. <table cellspacing="0">
  168. <tr>
  169. <th>PECL HTTP Enabled</th>
  170. <?php if (extension_loaded('http')): ?>
  171. <td class="pass">Pass</td>
  172. <?php else: ?>
  173. <td class="fail">Koseven can use the <a href="http://php.net/http">http</a> extension for the Request_Client_External class.</td>
  174. <?php endif ?>
  175. </tr>
  176. <tr>
  177. <th>cURL Enabled</th>
  178. <?php if (extension_loaded('curl')): ?>
  179. <td class="pass">Pass</td>
  180. <?php else: ?>
  181. <td class="fail">Koseven can use the <a href="http://php.net/curl">cURL</a> extension for the Request_Client_External class.</td>
  182. <?php endif ?>
  183. </tr>
  184. <tr>
  185. <th>mcrypt Enabled</th>
  186. <?php if (extension_loaded('mcrypt')): ?>
  187. <td class="pass">Pass</td>
  188. <?php else: ?>
  189. <td class="fail">Koseven requires <a href="http://php.net/mcrypt">mcrypt</a> for the Encrypt class.</td>
  190. <?php endif ?>
  191. </tr>
  192. <tr>
  193. <th>GD Enabled</th>
  194. <?php if (function_exists('gd_info')): ?>
  195. <td class="pass">Pass</td>
  196. <?php else: ?>
  197. <td class="fail">Koseven requires <a href="http://php.net/gd">GD</a> v2 for the Image class.</td>
  198. <?php endif ?>
  199. </tr>
  200. <tr>
  201. <th>MySQLi Enabled</th>
  202. <?php if (function_exists('mysqli_connect')): ?>
  203. <td class="pass">Pass</td>
  204. <?php else: ?>
  205. <td class="fail">Koseven can use the <a href="http://php.net/mysqli">MySQLi</a> extension to support MySQL databases.</td>
  206. <?php endif ?>
  207. </tr>
  208. <tr>
  209. <th>PDO Enabled</th>
  210. <?php if (class_exists('PDO')): ?>
  211. <td class="pass">Pass</td>
  212. <?php else: ?>
  213. <td class="fail">Koseven can use <a href="http://php.net/pdo">PDO</a> to support additional databases.</td>
  214. <?php endif ?>
  215. </tr>
  216. </table>
  217. </body>
  218. </html>