macos " 现有配置文件 (./config.inc.php) 不可读。"?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10258657/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 09:07:02  来源:igfitidea点击:

" Existing configuration file (./config.inc.php) is not readable. "?

macososx-lionxampproot

提问by Will

just installed XAMPP on my Mac. When I was trying to modify the upload dir in config.inc.phpit says that the file was locked, and can't be unlocked due to the fact that I don't have permission to modify the folder. So I changed the my permission to the folder, and file was not locked anymore but I can't access 'phpmyadmin' anymore in my browser via http://localhost/phpmyadmin/, everytime I try, it says "Existing configuration file (./config.inc.php) is not readable."

刚刚在我的 Mac 上安装了 XAMPP。当我尝试修改其中的上传目录时,config.inc.php它说该文件已被锁定,并且由于我无权修改该文件夹而无法解锁。所以我更改了我对该文件夹的权限,文件不再被锁定,但我http://localhost/phpmyadmin/每次尝试时都无法在浏览器中访问“phpmyadmin” ,它说"Existing configuration file (./config.inc.php) is not readable."

I googled the solution, from this page, it says to use chown root:cpanelphpmyadmin config.inc.phpto change the permission of the file. I did, but it says chown: cpanelphpmyadmin: Invalid argumentin my terminal window. I am get desperate here, anyone help me, please!

我从这个页面搜索了解决方案,它说chown root:cpanelphpmyadmin config.inc.php用于更改文件的权限。我做了,但它chown: cpanelphpmyadmin: Invalid argument在我的终端窗口中说。我在这里很绝望,请任何人帮助我!

by the way, I tried deleting everything in the XAMPP folder in App folder, and create a new one, it doesn't work

顺便说一句,我尝试删除 App 文件夹中 XAMPP 文件夹中的所有内容,并创建一个新的,它不起作用

回答by mahbubur

rasel@rasel-Dell:~$ sudo -s
rasel@rasel-Dell:~$ type your password
root@rasel-Dell:/# cd /opt/lampp/phpmyadmin
root@rasel-Dell:/opt/lampp/phpmyadmin# chmod 644 config.inc.php
root@rasel-Dell:/opt/lampp/phpmyadmin# cd /
root@rasel-Dell: /opt/lampp/lampp restart

That's all, it works for me.

就是这样,它对我有用。

回答by ATutorMe

For OSX Mavericks and XAMPP 1.8.2-5 and 1.8.3-4 versions, you need to use the same chmod 644 mentioned above, but the directory is different.

对于OSX Mavericks 和XAMPP 1.8.2-5 和1.8.3-4 版本,需要使用与上述相同的chmod 644,但目录不同。

cd /Applications/XAMPP/xamppfiles/phpmyadmin/
sudo chmod 644 config.inc.php
[enter your password]

回答by Robert Nguyen

cd /Applications/XAMPP/xamppfiles/phpmyadmin/
sudo chmod 777 config.inc.php
[enter your password]

After you change your config.inc.php, you need to type:

更改后config.inc.php,您需要键入:

sudo chmod 644 config.inc.php

Only sudo chmod 644didnt work for me.

只是sudo chmod 644没有对我来说有效。

回答by Luká? ?erny

I have solved the problem by creating a new config.inc.php file, copying all of the original locked config.inc.php content there and modifying the line

我已经通过创建一个新的 config.inc.php 文件解决了这个问题,将所有原始锁定的 config.inc.php 内容复制到那里并修改该行

$cfg['Servers'][$i]['password'] = 'myserverpassword'; 

and deleting the original locked file. This is in case you are looking for changing the XAMPP configuration file so that you can access the servers where you have put a new password.

并删除原来的锁定文件。这是为了防止您正在寻找更改 XAMPP 配置文件,以便您可以访问已输入新密码的服务器。

回答by Jayesh Katta Ramalingaiah

If you are using ubuntu 14.04 what you actually need to do is:

如果您使用的是 ubuntu 14.04,您实际需要做的是:

  1. Go to terminal
  2. type --> sudo nautilus
  3. a file dialogue will be opened.
  4. navigate the folder to computer/opt/lampp/phpmyadmin/config.inc.php
  5. open the file
  6. check for $cfg['Servers'][$i]['password'] = '';
  7. change the above LOC to $cfg['Servers'][$i]['password'] = 'root';
  1. 前往终端
  2. 输入 --> 须藤鹦鹉螺
  3. 将打开一个文件对话框。
  4. 将文件夹导航到 computer/opt/lampp/phpmyadmin/config.inc.php
  5. 打开文件
  6. 检查 $cfg['Servers'][$i]['password'] = '';
  7. 将上面的 LOC 更改为 $cfg['Servers'][$i]['password'] = 'root';

and try opening the phpmy admin. Your problem will be successfully solved.

并尝试打开phpmy admin。您的问题将得到成功解决。