= 80400 ? 'OK' : 'Needs 8.x+') . ')'; // mod_rewrite detection (approximate - Apache exposes this via SERVER_SOFTWARE or env) $rewrite_loaded = function_exists('apache_get_modules') ? (in_array('mod_rewrite', apache_get_modules()) ? 'YES (confirmed)' : 'NOT found in apache_get_modules()') : 'Unknown — apache_get_modules() not available (likely PHP-FPM or CGI)'; $checks['mod_rewrite'] = $rewrite_loaded; // SCRIPT_FILENAME vs DOCUMENT_ROOT — shows where PHP thinks the root is $checks['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'] ?? 'not set'; $checks['SCRIPT_FILENAME'] = $_SERVER['SCRIPT_FILENAME'] ?? 'not set'; $checks['REQUEST_URI'] = $_SERVER['REQUEST_URI'] ?? 'not set'; $checks['SERVER_SOFTWARE'] = $_SERVER['SERVER_SOFTWARE'] ?? 'not set'; // PHP handler type $checks['PHP SAPI'] = PHP_SAPI; // 'apache2handler' = mod_php, 'fpm-fcgi' = PHP-FPM, 'cgi-fcgi' = CGI // .htaccess readable test — write a known value and read it back via ini_get $checks['upload_max_filesize'] = ini_get('upload_max_filesize') . ' (want 200M — if showing default, .user.ini not applied yet or php_value blocked)'; $checks['memory_limit'] = ini_get('memory_limit'); // data directory web-accessible check $data_htaccess = __DIR__ . '/data/.htaccess'; $checks['data/.htaccess exists'] = file_exists($data_htaccess) ? 'YES' : 'MISSING — data directory is UNPROTECTED'; // Writable checks foreach (['data/users', 'data/files', 'data/uploads', 'data/pool', 'data/settings', 'data/invites', 'data/index', 'data/categories'] as $dir) { $path = __DIR__ . '/' . $dir; $checks['writable: ' . $dir] = is_writable($path) ? 'YES' : 'NO — chmod 755 or 775 required'; } // index.php exists $checks['index.php exists'] = file_exists(__DIR__ . '/index.php') ? 'YES' : 'MISSING'; // RewriteBase guess $script = $_SERVER['SCRIPT_NAME'] ?? '/check.php'; $base = rtrim(dirname($script), '/'); $checks['Detected RewriteBase'] = ($base === '' ? '/' : $base) . ' (use this in .htaccess if site is in a subdirectory)'; ?>
Delete check.php after confirming setup works.
| Check | Result |
|---|---|
If mod_rewrite is working, this link should load the home page (not a 404):
These always work regardless of mod_rewrite:
/index.php — /index.php?_r=setup
Share the output of this page if the 404 persists and mod_rewrite status is shown.