Hi,
I’ve just installed a new 14.0.0.19 and I get this error when running sudo -u www-data php occ maintenance:update:htaccess Error updating .htaccess file, not enough permissions or “overwrite.cli.url” set to an invalid URL?
Permissions are fine. I even set g+w as suggested on the forum
overwrite.cli.url on config.php containes the exact same string as the site’s url “https://foo-bar.bar.com”
It is failing in lib/private/Setup.php (line 448) in function updateHtaccess().
This particular check fails and for good reason:
$webRoot = parse_url($webRoot, PHP_URL_PATH);
if ($webRoot === null) {
return false;
}
It should be $PHP_URL_PATH. However, that is not the only problem. It is unset when called from cli.
I simply commented out the “return false;” to patch it. The final code looks like:
$webRoot = parse_url($webRoot, PHP_URL_PATH);
if ($webRoot === null) {
//return false;
}