X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Fsanity_check.php;h=0477efd5077fb37d81ea5a7385fe1e061c0b0fe5;hb=6322ac79a020ab584d412d782d62b2ee77d7c6cf;hp=11da859210b57a1c5632898919eb0d9e16a0e3b6;hpb=010efc9b814b433bc60353caec185d905688a32b;p=tt-rss.git diff --git a/include/sanity_check.php b/include/sanity_check.php index 11da8592..0477efd5 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -1,7 +1,27 @@ 0 && strlen(FEED_CRYPT_KEY) != 24) { + array_push($errors, "FEED_CRYPT_KEY should be exactly 24 characters in length."); + } + + if (strlen(FEED_CRYPT_KEY) > 0 && !function_exists("mcrypt_decrypt")) { + array_push($errors, "FEED_CRYPT_KEY requires mcrypt functions which are not found."); + } + if (GENERATED_CONFIG_CHECK != EXPECTED_CONFIG_VERSION) { array_push($errors, "Configuration option checker sanity_config.php is outdated, please recreate it using ./utils/regen_config_checks.sh"); @@ -49,33 +87,19 @@ } } - if (SESSION_EXPIRE_TIME < 60) { - array_push($errors, "SESSION_EXPIRE_TIME set in config.php is too low, please set it to an integer value >= 60"); - } - - if (SESSION_EXPIRE_TIME < SESSION_COOKIE_LIFETIME) { - array_push($errors, "SESSION_EXPIRE_TIME set in config.php should be >= to SESSION_COOKIE_LIFETIME"); - } - if (SINGLE_USER_MODE) { - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - - if ($link) { - $result = db_query($link, "SELECT id FROM ttrss_users WHERE id = 1"); + $result = db_query( "SELECT id FROM ttrss_users WHERE id = 1"); - if (db_num_rows($result) != 1) { - array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found."); - } + if (db_num_rows($result) != 1) { + array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found."); } } if (SELF_URL_PATH == "http://yourserver/tt-rss/") { - if ($_SERVER['HTTP_REFERER']) { - array_push($errors, - "Please set SELF_URL_PATH to the correct value for your server (possible value: " . $_SERVER['HTTP_REFERER'] . ")"); - } else { - array_push($errors, "Please set SELF_URL_PATH to the correct value for your server."); - } + $urlpath = preg_replace("/\w+\.php$/", "", make_self_url_path()); + + array_push($errors, + "Please set SELF_URL_PATH to the correct value for your server (possible value: $urlpath)"); } if (!is_writable(ICONS_DIR)) { @@ -86,10 +110,6 @@ array_push($errors, "LOCK_DIRECTORY defined in config.php is not writable (chmod -R 777 ".LOCK_DIRECTORY.").\n"); } - if (ini_get("open_basedir")) { - array_push($errors, "PHP configuration option open_basedir is not supported. Please disable this in PHP settings file (php.ini)."); - } - if (!function_exists("curl_init") && !ini_get("allow_url_fopen")) { array_push($errors, "PHP configuration option allow_url_fopen is disabled, and CURL functions are not present. Either enable allow_url_fopen or install PHP extension for CURL."); } @@ -118,10 +138,14 @@ array_push($errors, "PHP support for ctype functions are required by HTMLPurifier."); } - if (ini_get("safe_mode")) { - array_push($errors, "PHP safe mode setting is not supported."); + if (!function_exists("iconv")) { + array_push($errors, "PHP support for iconv is required to handle multiple charsets."); } + /* if (ini_get("safe_mode")) { + array_push($errors, "PHP safe mode setting is not supported."); + } */ + if ((PUBSUBHUBBUB_HUB || PUBSUBHUBBUB_ENABLED) && !function_exists("curl_init")) { array_push($errors, "PHP support for CURL is required for PubSubHubbub."); } @@ -139,7 +163,8 @@ - + +

Startup failed

@@ -151,6 +176,8 @@

You might want to check tt-rss wiki or the forums for more information. Please search the forums before creating new topic for your question.

+ +
@@ -164,13 +191,13 @@ echo " * $error\n"; } - echo "\nYou might want to check tt-rss wik or the forums for more information.\n"; + echo "\nYou might want to check tt-rss wiki or the forums for more information.\n"; echo "Please search the forums before creating new topic for your question.\n"; exit(-1); } } - initial_sanity_check($link); + initial_sanity_check(); ?>