{"record":{"id":"ae6c801bd6d6449a","repo":"Dolibarr/dolibarr","slug":"error-dolibarr-config-file-content-seems-to-be-not-correctly","errorCode":null,"errorMessage":"Error: Dolibarr config file content seems to be not correctly defined (dolibarr_main_document_root can't be unknown / file ${DOL_DOCUMENT_ROOT}/core/lib/functions.lib.php not found). Please run dolibarr setup by calling page <b>/install</b>.","messagePattern":"Error: Dolibarr config file content seems to be not correctly defined \\(dolibarr_main_document_root can't be unknown / file (.+?)/core/lib/functions\\.lib\\.php not found\\)\\. Please run dolibarr setup by calling page <b>/install</b>\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"htdocs/filefunc.inc.php","lineNumber":312,"sourceCode":"\t$dolibarr_mailing_limit_sendbyweb = 0;\n}\nif (empty($dolibarr_mailing_limit_sendbycli)) {\n\t$dolibarr_mailing_limit_sendbycli = 0;\n}\nif (empty($dolibarr_mailing_limit_sendbyday)) {\n\t$dolibarr_mailing_limit_sendbyday = 0;\n}\nif (empty($dolibarr_strict_mode)) {\n\t$dolibarr_strict_mode = 0; // For debug in php strict mode\n}\n\nif (!defined('DOL_DOCUMENT_ROOT')) {\n\tdefine('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)\n}\n\n// @phpstan-ignore-next-line if.alwaysTrue\nif (empty(DOL_DOCUMENT_ROOT) || !file_exists(DOL_DOCUMENT_ROOT.\"/core/lib/functions.lib.php\")) {\n\tprint \"Error: Dolibarr config file content seems to be not correctly defined\";\n\tif (empty($dolibarr_main_document_root)) {\n\t\tprint \" (dolibarr_main_document_root can't be unknown).<br>\\n\";\n\t} else {\n\t\tprint \" (file \".DOL_DOCUMENT_ROOT.\"/core/lib/functions.lib.php not found).<br>\\n\";\n\t}\n\tprint \"Please run dolibarr setup by calling page <b>/install</b>.<br>\\n\";\n\texit(1);\n}\n\n\n// Included by default (must be before the CSRF check so wa can use the dol_syslog)\ninclude_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';\ninclude_once DOL_DOCUMENT_ROOT.'/core/lib/html.lib.php';\ninclude_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';\ninclude_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/securitycore.lib.php';\n//print memory_get_usage();\n\n","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/Dolibarr/dolibarr/blob/598aa4bdada683d17ca04b1842548821ff0eb6c6/htdocs/filefunc.inc.php#L294-L330","documentation":"filefunc.inc.php, after loading conf.php, verifies that DOL_DOCUMENT_ROOT is set and that <DOL_DOCUMENT_ROOT>/core/lib/functions.lib.php physically exists. If not, the config file's dolibarr_main_document_root path is wrong or the install tree is incomplete, so it prints this setup error and stops. It guards against running Dolibarr with a broken configuration before any library code is loaded.","triggerScenarios":"conf.php defines a dolibarr_main_document_root that is empty or points to a directory lacking core/lib/functions.lib.php (bad path after moving the install, wrong case, missing files after a partial upgrade/git checkout).","commonSituations":"Moving Dolibarr to another server/directory without editing htdocs/conf/conf.php; deploying only conf.php (persistent volume) to a fresh container with a mismatched path; typos like missing trailing component or Windows path vs Linux; incomplete upload/extract of htdocs.","solutions":["Edit htdocs/conf/conf.php and set $dolibarr_main_document_root to the absolute filesystem path of the htdocs directory (e.g. '/var/www/dolibarr/htdocs').","Verify that <path>/core/lib/functions.lib.php exists and is readable by the web server (ls -l / check permissions, SELinux context).","Re-upload/restore the complete htdocs tree if files are missing (compare against a release archive).","On moved installs also fix dolibarr_main_url_root in conf.php to the new URL.","If conf.php was generated by the installer for a different environment, re-run /install or hand-edit it for the new paths."],"exampleFix":"// before (htdocs/conf/conf.php)\n$dolibarr_main_document_root = '/home/olduser/dolibarr/htdocs';\n// after\n$dolibarr_main_document_root = '/var/www/dolibarr/htdocs';\n$dolibarr_main_url_root      = 'https://doli.example.com';","handlingStrategy":"validation","validationCode":"// verify config before bootstrapping Dolibarr\n$root = '$dolibarr_main_document_root value from conf.php';\nif (empty($root) || !is_file(rtrim($root,'/').'/core/lib/functions.lib.php')) {\n    throw new RuntimeException('dolibarr_main_document_root is empty or points to an incomplete htdocs tree');\n}","typeGuard":"function dolDocumentRootIsValid(?string $root): bool {\n    return !empty($root) && is_dir($root) && is_file(rtrim($root, '/').'/core/lib/functions.lib.php');\n}","tryCatchPattern":null,"preventionTips":["After moving or copying the install, always update dolibarr_main_document_root to the new absolute htdocs path.","Verify file existence and web-server read permissions (and SELinux contexts) after deploys.","Deploy the full htdocs tree atomically; never ship conf.php without matching code.","In containers, mount conf.php into the same image path the code was built for.","Keep a post-deploy smoke check that loads the homepage and fails on 'config file content seems to be not correctly defined'."],"tags":["configuration","install","file-not-found"],"backgroundTag":"missing-required-config-field","analyzedSha":"598aa4bdada683d17ca04b1842548821ff0eb6c6","analyzedAt":"2026-09-14T11:12:15.309Z","contentChangedAt":"2026-09-14T11:12:15.309Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}