3 // Sanity check, install should only be checked from index.php
4 defined('SYSPATH') or exit('Install tests must be loaded from within index.php!');
6 if (version_compare(PHP_VERSION
, '5.3', '<'))
8 // Clear out the cache to prevent errors. This typically happens on Windows/FastCGI.
13 // Clearing the realpath() cache is only possible PHP 5.3+
18 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
19 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
21 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en" lang
="en">
24 <meta http
-equiv
="Content-Type" content
="text/html; charset=utf-8" />
25 <title
>Kohana Installation
</title
>
27 <style type
="text/css">
28 body
{ width
: 42em
; margin
: 0 auto
; font
-family
: sans
-serif
; background
: #fff; font-size: 1em; }
29 h1
{ letter
-spacing
: -0.04em
; }
30 h1 + p
{ margin
: 0 0 2em
; color
: #333; font-size: 90%; font-style: italic; }
31 code
{ font
-family
: monaco
, monospace
; }
32 table
{ border
-collapse
: collapse
; width
: 100%
; }
34 table td
{ padding
: 0.4em
; text
-align
: left
; vertical
-align
: top
; }
35 table th
{ width
: 12em
; font
-weight
: normal
; }
36 table tr
:nth
-child(odd
) { background
: #eee; }
37 table td
.pass
{ color
: #191; }
38 table td
.fail
{ color
: #911; }
39 #results { padding: 0.8em; color: #fff; font-size: 1.5em; }
40 #results.pass { background: #191; }
41 #results.fail { background: #911; }
47 <h1
>Environment Tests
</h1
>
50 The following tests have been run to determine
if <a href
="http://kohanaframework.org/">Kohana
</a
> will work in your environment
.
51 If any of the tests have failed
, consult the
<a href
="http://kohanaframework.org/guide/about.install">documentation
</a
>
52 for more information on how to correct the problem
.
55 <?php
$failed = FALSE ?
>
57 <table cellspacing
="0">
60 <?php
if (version_compare(PHP_VERSION
, '5.2.3', '>=')): ?
>
61 <td
class="pass"><?php
echo PHP_VERSION ?
></td
>
62 <?php
else: $failed = TRUE ?
>
63 <td
class="fail">Kohana requires PHP
5.2.3 or newer
, this version is
<?php
echo PHP_VERSION ?
>.</td
>
67 <th
>System Directory
</th
>
68 <?php
if (is_dir(SYSPATH
) AND is_file(SYSPATH
.'classes/kohana'.EXT
)): ?
>
69 <td
class="pass"><?php
echo SYSPATH ?
></td
>
70 <?php
else: $failed = TRUE ?
>
71 <td
class="fail">The configured
<code
>system
</code
> directory does not exist
or does not contain required files
.</td
>
75 <th
>Application Directory
</th
>
76 <?php
if (is_dir(APPPATH
) AND is_file(APPPATH
.'bootstrap'.EXT
)): ?
>
77 <td
class="pass"><?php
echo APPPATH ?
></td
>
78 <?php
else: $failed = TRUE ?
>
79 <td
class="fail">The configured
<code
>application
</code
> directory does not exist
or does not contain required files
.</td
>
83 <th
>Cache Directory
</th
>
84 <?php
if (is_dir(APPPATH
) AND is_dir(APPPATH
.'cache') AND is_writable(APPPATH
.'cache')): ?
>
85 <td
class="pass"><?php
echo APPPATH
.'cache/' ?
></td
>
86 <?php
else: $failed = TRUE ?
>
87 <td
class="fail">The
<code
><?php
echo APPPATH
.'cache/' ?
></code
> directory is not writable
.</td
>
91 <th
>Logs Directory
</th
>
92 <?php
if (is_dir(APPPATH
) AND is_dir(APPPATH
.'logs') AND is_writable(APPPATH
.'logs')): ?
>
93 <td
class="pass"><?php
echo APPPATH
.'logs/' ?
></td
>
94 <?php
else: $failed = TRUE ?
>
95 <td
class="fail">The
<code
><?php
echo APPPATH
.'logs/' ?
></code
> directory is not writable
.</td
>
100 <?php
if ( ! @preg_match
('/^.$/u', 'ñ')): $failed = TRUE ?
>
101 <td
class="fail"><a href
="http://php.net/pcre">PCRE
</a
> has not been compiled with UTF
-8 support
.</td
>
102 <?php
elseif ( ! @preg_match
('/^\pL$/u', 'ñ')): $failed = TRUE ?
>
103 <td
class="fail"><a href
="http://php.net/pcre">PCRE
</a
> has not been compiled with Unicode property support
.</td
>
105 <td
class="pass">Pass
</td
>
110 <?php
if (function_exists('spl_autoload_register')): ?
>
111 <td
class="pass">Pass
</td
>
112 <?php
else: $failed = TRUE ?
>
113 <td
class="fail">PHP
<a href
="http://www.php.net/spl">SPL
</a
> is either not loaded
or not compiled in
.</td
>
117 <th
>Reflection Enabled
</th
>
118 <?php
if (class_exists('ReflectionClass')): ?
>
119 <td
class="pass">Pass
</td
>
120 <?php
else: $failed = TRUE ?
>
121 <td
class="fail">PHP
<a href
="http://www.php.net/reflection">reflection
</a
> is either not loaded
or not compiled in
.</td
>
125 <th
>Filters Enabled
</th
>
126 <?php
if (function_exists('filter_list')): ?
>
127 <td
class="pass">Pass
</td
>
128 <?php
else: $failed = TRUE ?
>
129 <td
class="fail">The
<a href
="http://www.php.net/filter">filter
</a
> extension is either not loaded
or not compiled in
.</td
>
133 <th
>Iconv Extension Loaded
</th
>
134 <?php
if (extension_loaded('iconv')): ?
>
135 <td
class="pass">Pass
</td
>
136 <?php
else: $failed = TRUE ?
>
137 <td
class="fail">The
<a href
="http://php.net/iconv">iconv
</a
> extension is not loaded
.</td
>
140 <?php
if (extension_loaded('mbstring')): ?
>
142 <th
>Mbstring Not Overloaded
</th
>
143 <?php
if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING
): $failed = TRUE ?
>
144 <td
class="fail">The
<a href
="http://php.net/mbstring">mbstring
</a
> extension is overloading PHP
's native string functions.</td>
146 <td class="pass">Pass</td>
151 <th>Character Type (CTYPE) Extension</th>
152 <?php if ( ! function_exists('ctype_digit
')): $failed = TRUE ?>
153 <td class="fail">The <a href="http://php.net/ctype">ctype</a> extension is not enabled.</td>
155 <td class="pass">Pass</td>
159 <th>URI Determination</th>
160 <?php if (isset($_SERVER['REQUEST_URI
']) OR isset($_SERVER['PHP_SELF
']) OR isset($_SERVER['PATH_INFO
'])): ?>
161 <td class="pass">Pass</td>
162 <?php else: $failed = TRUE ?>
163 <td class="fail">Neither <code>$_SERVER['REQUEST_URI
']</code>, <code>$_SERVER['PHP_SELF
']</code>, or <code>$_SERVER['PATH_INFO
']</code> is available.</td>
168 <?php if ($failed === TRUE): ?>
169 <p id="results" class="fail">✘ Kohana may not work correctly with your environment.</p>
171 <p id="results" class="pass">✔ Your environment passed all requirements.<br />
172 Remove or rename the <code>install<?php echo EXT ?></code> file now.</p>
175 <h1>Optional Tests</h1>
178 The following extensions are not required to run the Kohana core, but if enabled can provide access to additional classes.
181 <table cellspacing="0">
183 <th>cURL Enabled</th>
184 <?php if (extension_loaded('curl
')): ?>
185 <td class="pass">Pass</td>
187 <td class="fail">Kohana requires <a href="http://php.net/curl">cURL</a> for the Remote class.</td>
191 <th>mcrypt Enabled</th>
192 <?php if (extension_loaded('mcrypt
')): ?>
193 <td class="pass">Pass</td>
195 <td class="fail">Kohana requires <a href="http://php.net/mcrypt">mcrypt</a> for the Encrypt class.</td>
200 <?php if (function_exists('gd_info
')): ?>
201 <td class="pass">Pass</td>
203 <td class="fail">Kohana requires <a href="http://php.net/gd">GD</a> v2 for the Image class.</td>
208 <?php if (class_exists('PDO
')): ?>
209 <td class="pass">Pass</td>
211 <td class="fail">Kohana can use <a href="http://php.net/pdo">PDO</a> to support additional databases.</td>