“Setup not allowed by conf.php permissions”
The Dolibarr installer refuses to start because of the conf.php file. What the message means, the command that fixes it, and the chmod 666 trap.
You open the Dolibarr installer. On the prerequisites page, instead of the “Start” button, you get:
Configuration file htdocs/conf/conf.php is not writable. Check permissions. Setup not allowed by conf.php permissions
What the message means
During installation, the installer writes your settings (database, folders, site address) into
htdocs/conf/conf.php. So it first checks that the web server can write to that file. Your own
account does not matter here: what matters is the account Apache or PHP-FPM runs as, www-data on
Debian and Ubuntu.
The file exists, but that account cannot modify it, so the installer stops. Nothing is broken: it is a check.
Variant: “does not exist and could not be created”
If conf.php does not exist at all, the installer tries to create it from conf.php.example. When
the conf/ folder is read-only too, it shows:
Configuration file htdocs/conf/conf.php does not exist and could not be created! You must create file htdocs/conf/conf.php and set write permissions on it for the web server during install process.
Same cause, same fix.
The fix on a Linux server
From the folder where Dolibarr is installed (the one that contains htdocs/):
sudo touch htdocs/conf/conf.php
sudo chown www-data:www-data htdocs/conf/conf.php
The first command is only needed if the file does not exist. Then reload the installer page: the line becomes “Configuration file htdocs/conf/conf.php is writable” and the “Start” button is back.
If your web server does not run as www-data, this command gives you its name:
ps aux | grep -E 'apache|httpd|php-fpm'
The first column is the user. Ignore the root line, which is the main process: the other lines
give the web server account.
In Docker
With the official dolibarr/dolibarr image, the file is inside the container at
/var/www/html/conf/conf.php:
docker exec <container> chown www-data:www-data /var/www/html/conf/conf.php
The chmod 666 trap
Dolibarr’s message suggests chmod 666. It does unblock the installation, including when chown
is not available, from an FTP client for instance. But it has to be undone afterwards.
Once installed, Dolibarr wants a read-only conf.php. When the file belongs to the web server, it
removes the write permission itself the first time an administrator opens the home page: on the
test instance, the file went from 644 to 444 on its own. When the file belongs to another account,
which is the case after a chmod 666, it cannot, and the home page shows:
Warning, your config file (htdocs/conf/conf.php) can be overwritten by the web server. This is a serious security hole.
To make it go away:
sudo chmod 444 htdocs/conf/conf.php
That is why chown is the better option: Dolibarr then locks the file down by itself.
Right after installation
One step remains that the installer does not do for you: adding the install.lock file, which
closes the installation pages. See
install.lock: where to put it, and how to upgrade with it.
Getting help
If you would rather have it done for you, installation and setup is a fixed-price package, quoted before any work starts.