diff options
author | Andrew Dolgov <[email protected]> | 2010-12-27 15:09:30 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-12-27 15:09:30 +0300 |
commit | 7bb8d39a06e232d85b8a469ecb6e41963f56bb77 (patch) | |
tree | fb8b28c0a4d0e4dc5eb62aa97bcc224d6848752b /sanity_check.php | |
parent | f52df691c3c8797a6a97914167c6b4873a273a28 (diff) |
add sanity checks for mbstring, json, postgresql and mysql functions, safe mode and open_basedir (refs #281)
Diffstat (limited to 'sanity_check.php')
-rw-r--r-- | sanity_check.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sanity_check.php b/sanity_check.php index b20c57d9e..a33b7c19e 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -110,6 +110,34 @@ $err_msg = "config: your ICONS_DIR (" . ICONS_DIR . ") is not writable.\n"; } + if (ini_get("open_basedir")) { + $err_msg = "php.ini: open_basedir is not supported."; + } + + if (!ini_get("allow_url_fopen")) { + $err_msg = "php.ini: allow_url_fopen is required."; + } + + if (!function_exists("json_encode")) { + $err_msg = "PHP: json functions not found."; + } + + if (DB_TYPE == "mysql" && !function_exists("mysql_connect")) { + $err_msg = "PHP: MySQL functions not found."; + } + + if (DB_TYPE == "pgsql" && !function_exists("pg_connect")) { + $err_msg = "PHP: PostgreSQL functions not found."; + } + + if (!function_exists("mb_strlen")) { + $err_msg = "PHP: mbstring functions not found."; + } + + if (ini_get("safe_mode")) { + $err_msg = "php.ini: Safe mode is not supported. If you wish to continue, remove this test from sanity_check.php and proceeed at your own risk. Please note that your bug reports will not be accepted or reviewed."; + } + if ($err_msg) { print "<b>Fatal Error</b>: $err_msg\n"; exit; |