Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

phpMyAdmin stops with a wrong-permissions message about config.inc.php

ErrorWrong permissions on configuration file, should not be world writable!

Short answer

phpMyAdmin checks that config.inc.php cannot be written by everyone and stops if it can. Find the real file, then remove write access for others, for example with chmod 660. Switch the check off with CheckConfigurationPermissions only when the file sits on a filesystem that cannot hold Unix permissions.

  • Applies to phpMyAdmin 5.2, Ubuntu 24.04, PHP 8.3
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Show the permissions of the config file phpMyAdmin loads. On Debian and Ubuntu packages it lives in /etc/phpmyadmin; in a downloaded copy it is in the top folder.

    ls -l /etc/phpmyadmin/config.inc.php /var/www/html/phpmyadmin/config.inc.php
  2. 2Match what you see, then jump to its fix

    1. 1ls -l shows a w in the last group of the mode, such as -rwxrwxrwx or -rw-rw-rw-The file really is writable by every userFix
    2. 2chmod runs without an error, yet ls -l keeps showing the same wide-open modeThe files sit on a drive that cannot show real permissionsFix

What does the error look like?

  • Wrong permissions on configuration file, should not be world writable!

Cause 1 of 2

The file really is writable by every user

1Check

Look at the mode string. Three groups of letters follow the dash: owner, group, others. A w in the third group is what phpMyAdmin rejects. Unzipping with a loose umask, or an earlier chmod 777, leaves it this way.

stat -c '%a %U:%G %n' /etc/phpmyadmin/config.inc.php

2Fix

Take write access away from others. The phpMyAdmin FAQ suggests 660 for this file; use the path your check showed.

sudo chmod 660 /etc/phpmyadmin/config.inc.php

3Verify

Reload the phpMyAdmin page. The mode now ends in 0 and the login screen appears. The web server user must still be able to read the file through its owner or group.

stat -c '%a %U:%G %n' /etc/phpmyadmin/config.inc.php

Confirmed by docs.phpmyadmin.net

Did this fix it?

Cause 2 of 2

The files sit on a drive that cannot show real permissions

1Check

phpMyAdmin can be installed on an NTFS volume mounted on a non-Windows server. Such mounts report permissions that look wrong and cannot be told apart from real ones, so the check misfires.

findmnt -T /var/www/html/phpmyadmin

2Fix

If the mount really cannot store Unix permissions, set the documented option to false in config.inc.php. Do not use this on a normal ext4 or xfs disk, where fixing the mode is the right answer.

<?php
$cfg['CheckConfigurationPermissions'] = false;

3Verify

Reload phpMyAdmin; the message is gone.

curl -sI http://localhost/phpmyadmin/ | head -n 1

Confirmed by docs.phpmyadmin.net

Did this fix it?

How do I stop it coming back?

  • Never use chmod -R 777 on a web root to get past a permission problem.
  • Keep config.inc.php readable only by the web server user and its owner.
  • After unpacking a new phpMyAdmin release, check the mode of the config file before opening it in a browser.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

nginx gives up waiting for the app and returns 504

upstream timed out (110: Connection timed out) while reading response header from upstream

nginx returns 504 when the app behind it takes the request but sends nothing back within proxy_read_timeout (60 seconds by default), or when the connection cannot be opened in time.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.