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

UbuntuPhpmyadmin

Ubuntu Problem Overview


I get this error when I try to access localhost/phpmyadmin:

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

I have already chmoded every file to 555 from 777. What should I do next? I run Ubuntu 11.04.

Ubuntu Solutions


Solution 1 - Ubuntu

Try this it will work

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

Solution 2 - Ubuntu

Try

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

This command fixed the issue having on my Ubuntu 14.04.

Solution 3 - Ubuntu

This is because of wrong permission of phpMyAdmin directory and the file config.inc.php

On *nix like OS set the permission of the directory and the file as follows

chmod -R 755 /path/to/phpMyAdmin
chmod 644 /path/to/phpMyAdmin/config.inc.php

If like me you run a Linux Virtual Machine which mount a Windows folder where phpMyAdmin sources are located, edit config.inc.php and add this line

$cfg['CheckConfigurationPermissions'] = false;

Solution 4 - Ubuntu

This worked for me: $ pkexec chmod 755 -R /etc/phpmyadmin

Solution 5 - Ubuntu

You should not be making them 777 (which is writeable by everyone). Try 644 instead, which means user has read and write and group and others can only read.

Solution 6 - Ubuntu

For Mac OS users:

Find the file named config.inc.php, usually located in /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php

(this is the filepath on my Mac)

Then click the right mouse click -> Click on Get Info, at the bottom of the box you will find permissions-> click on the Lock icon (bottom right corner) -> Put your System Admin Password -> -> where it says everyone, modify this permission to READ ONLY -> click back on the Lock icon and try to open

http://localhost/phpMyadmin

Solution 7 - Ubuntu

Just in case, someone out there having same issue but changing file permission doesn't solve the issue, add this line to your config.inc.php file

<?php
// other config goes here . . . 
$cfg['CheckConfigurationPermissions'] = false;

And you're good to go.


In my case, I'm using windows 10 WSL with phpmyadmin installed on D: drive. There's no way to (for now) change file permission on local disk through WSL unless your installation directory is inside WSL filesystem it-self. There's updates according to this issue, but still on insider build.

Cheers.

Solution 8 - Ubuntu

I just solved this problem myself, and this question/answer pair was not helpful to me in particular, so I will add what solved it for me in my specific case.

For starters, I have just began to use a repository so I "chmod 777 -R"'ed my entire /opt/lampp directory to make sure that permissions were not an issue for the pushing of the repository. Then I got two errors, but I think I only saw one of them and the next one showed up after fixing the first one it. I suppose one error was upstaging the other.

The first one was ./lampp/etc/my.cnf A chmod 700 on that file fixed it in my case although, 755 seems to be the better choice that I found in my research.

One file down, one more to go. The other file, which is the one causing the specific error message in this question is ./lampp/phpmyadmin/config.inc.php.

Solution: "$ chmod 755 -R /opt/lampp/phpmyadmin"

Solution 9 - Ubuntu

I got the same problem as you. I fixed this problem by following this post :D

But I didn't change the permission from 777 to 755 :O

http://blog.elijaa.org/index.php?post/2013/02/19/Solve-Wrong-permissions-on-configuration-file%2C-should-not-be-world-writable!-error-on-phpMyAdmin

Solution 10 - Ubuntu

all you need is to

  1. open terminal type

    opt/lampp/lampp start

to start it and then

  1. sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

then visit in your browser

localhost/phpmyadmin

it will work fine.

Solution 11 - Ubuntu

I run my system on top of a XAMPP instalation on a OS X.

A few days ago I faced the same problem. I was getting a lot of permission problems when installing and managing CMS test platforms, so I decided to set the entire htdocs subtree to a+rwX permissions, and got the same error.

Although my decision to set the entire subtree to those permissions is generally a mistake, that I made knowingly because this system is only accessable by localhost and otherwise unreachable, the only file that needs permission changing to solve this issue is config.inc.php, and you can leave the rest with the permissions you think you need.

The problem is fixed with:
chmod 644 config.inc.php, or sudo chmod 644 config.inc.php, depending on the system. (issued inside the phpmyadmin folder)

Solution 12 - Ubuntu

This error occured because phpmyadmin directory has all permissions (777). you can resolved this problem by executing the following command.

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

Solution 13 - Ubuntu

For Mac sudo chmod 755 /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php Worked for me

Solution 14 - Ubuntu

Do the following in your terminal

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

After this you have to restart your server

Solution 15 - Ubuntu

try if install lampp

sudo chown www-data:www-data -R /opt/lampp/phpmyadmin/*
sudo chown www-data:www-data -R /opt/lampp/phpmyadmin

or if install phpmyadmin

sudo chown www-data:www-data -R /etc/phpmyadmin/*
sudo chown www-data:www-data -R /etc/phpmyadmin

Solution 16 - Ubuntu

What the hell? errors say that the file should not be 755 but everyone says should be 755. You should change the permission of the file into 444 to protect it from the edit.

run this command:

sudo chmod 444 /opt/lampp/phpmyadmin/config.inc.php

Solution 17 - Ubuntu

Mac/ MAMP:

sudo chmod -R 755 /Applications/MAMP/bin/phpMyAdmin 

worked for me.

Solution 18 - Ubuntu

On My Mac using XAMPP i simply did

sudo chmod 755 /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php

Solution 19 - Ubuntu

These problem arises due to permission we can't give the all permission of our database config If you are using ubuntu and you have the path like this /opt/lampp then type the following command in terminal.

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php

Solution 20 - Ubuntu

To restrict access on this file /phpmyadmin/config.inc.php and he will work.

Simple tape this : sudo chmod 750 /phpmyadmin/config.inc.php !

Solution 21 - Ubuntu

If you are using ubutu and you have the path like this /opt/lampp then type the following command in terminal.

sudo pkexec chmod 755 -R /opt/lampp/phpmyadmin

Hope this will find out your solution.

Solution 22 - Ubuntu

you should change the owner of the server by chown command

from home you can run this command

sudo chown {userName} -R ../../opt

If it does not work yet, run this command

sudo chmod 777 -R ../../opt

It should work now.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiongood_eveningView Question on Stackoverflow
Solution 1 - UbuntuY. Joy Ch. SinghaView Answer on Stackoverflow
Solution 2 - UbuntudiEchoView Answer on Stackoverflow
Solution 3 - UbuntuNur RonyView Answer on Stackoverflow
Solution 4 - UbuntuVladimir VukanacView Answer on Stackoverflow
Solution 5 - UbuntualexView Answer on Stackoverflow
Solution 6 - UbuntubpositivestudioView Answer on Stackoverflow
Solution 7 - UbuntuFery WView Answer on Stackoverflow
Solution 8 - UbuntuRyan MortensenView Answer on Stackoverflow
Solution 9 - UbuntuKannikaView Answer on Stackoverflow
Solution 10 - UbuntuRaheel KhanView Answer on Stackoverflow
Solution 11 - Ubuntuzejoao2000View Answer on Stackoverflow
Solution 12 - UbuntuNaveen GuptaView Answer on Stackoverflow
Solution 13 - UbuntuRohit DhoreView Answer on Stackoverflow
Solution 14 - UbuntuRajkumar RView Answer on Stackoverflow
Solution 15 - UbuntuMahdi BagheriView Answer on Stackoverflow
Solution 16 - Ubuntuاسماعیل زارعView Answer on Stackoverflow
Solution 17 - UbuntuMalisha De SilvaView Answer on Stackoverflow
Solution 18 - UbuntuIan SamzView Answer on Stackoverflow
Solution 19 - UbuntuRahul DubeyView Answer on Stackoverflow
Solution 20 - Ubuntuuser3775750View Answer on Stackoverflow
Solution 21 - UbuntuRahamView Answer on Stackoverflow
Solution 22 - UbuntukhaledView Answer on Stackoverflow