69

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.

good_evening
  • 21,085
  • 65
  • 193
  • 298

25 Answers25

95

Try this it will work

sudo chmod 755 /opt/lampp/phpmyadmin/config.inc.php
bad_coder
  • 11,289
  • 20
  • 44
  • 72
Y. Joy Ch. Singha
  • 3,056
  • 24
  • 26
74

Try

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

This command fixed the issue having on my Ubuntu 14.04.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
xkeshav
  • 53,360
  • 44
  • 177
  • 245
44

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;
Mycodingproject
  • 1,031
  • 1
  • 9
  • 13
Nur Rony
  • 7,823
  • 7
  • 38
  • 45
15

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

Vladimir Vukanac
  • 944
  • 16
  • 29
14

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 http://localhost/phpmyadmin

bad_coder
  • 11,289
  • 20
  • 44
  • 72
bpositivestudio
  • 141
  • 1
  • 2
11

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.

alex
  • 479,566
  • 201
  • 878
  • 984
  • I have this problem and I changed the permissions but I'm still getting the error. I think there are more steps you can take to troubleshoot... – AlxVallejo Aug 22 '12 at 16:48
10

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.

Fery W
  • 1,402
  • 1
  • 15
  • 28
9

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"

Ryan Mortensen
  • 2,307
  • 3
  • 22
  • 27
4

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

Kannika
  • 2,538
  • 2
  • 27
  • 38
4

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.

Raheel Khan
  • 464
  • 10
  • 12
2

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)

zejoao2000
  • 21
  • 2
2

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
Bertrand Martel
  • 42,756
  • 16
  • 135
  • 159
Naveen Gupta
  • 306
  • 3
  • 11
2

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

Rohit Dhore
  • 191
  • 3
  • 15
1

Do the following in your terminal

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

After this you have to restart your server

Rajkumar R
  • 1,097
  • 8
  • 14
1

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
1

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
1

Mac/ MAMP:

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

worked for me.

Malisha De Silva
  • 393
  • 2
  • 10
0

On My Mac using XAMPP i simply did

sudo chmod 755 /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php
Ian Samz
  • 1,743
  • 20
  • 20
0

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
Mohnish
  • 1,010
  • 1
  • 12
  • 20
0

For me, the error just appaered this morning, without doing any updates.

If your using the official docker container without Your own config.inc.php, You can find the file located in /etc/phpmyadmin

So the solution would be

docker exec nameofyourphpmyadmincontainer chmod 0644 /etc/phpmyadmin/config.inc.php

or mount an external config.inc.php into docker container on start.

sneaky
  • 439
  • 1
  • 6
  • 18
0
  1. Goto lampp folder and change the owner back to root
  2. Change permission to 755 -> This will start the phpmyadmin working again
  3. Goto htdocs folder and make your user as owner of the folder and give 777 permission so that you can start the localhost project
  4. If with step 3 error such as write access denied comes, then for htdocs folder, right click and give permissions to all files/folders recursively

Hope this helps.

Aditya
  • 133
  • 2
  • 11
0

for macbook users who didn't understand how to navigate to config.inc.php

  1. open terminal
  2. execute this command cd /Applications/XAMPP/xamppfiles/phpmyadmin
  3. execute this command sudo chmod 755 config.inc.php
Raj
  • 946
  • 12
  • 16
-1

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

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

MaxiGui
  • 6,190
  • 4
  • 16
  • 33
-1

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.

Raham
  • 4,781
  • 3
  • 24
  • 27
-1

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.

khaled
  • 11
  • 3