LoginSignup
8
5

More than 3 years have passed since last update.

【mac】XAMPP7.3.11環境構築_config.inc.phpの編集&上書き保存方法

Last updated at Posted at 2019-11-09

<<更新日::2019年11月9日>>

config.inc.phpを上書き保存できない問題

phpmyadmin よりdatabase権限でパスワードを設定したのち、config.inc.phpのAuthentication typeを変更したい。

config.inc.php
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
,
,
,

ここで初見殺しが発生する。

上書き保存をしようとすると Unable to save Permission denied となり変更が保存できないケースだ。

解決策

結論からいうと、root@debian権限で編集すればOK。
以下、解決策の手順を示す。

1.XAMPP.appから Open Terminalをクリック
Screenshot 2019-11-09 21.32.05.png

2.開いたterminalにて、Debian用パッケージ管理システムをupdateして、nanoエディタをインストールする

root@debian: apt-get update
root@debian: apt-get install nano

  

3.root@debianでterminalが開くので、phpmyadminフォルダに移動。
※XAMPPなのにLAMPPフォルダ内に存在するが気にしない。

root@debian:~# cd ../opt/lampp/phpmyadmin

  

4.nano エディタをconfig.inc.phpを開く。

root@debian:/opt/lampp/phpmyadmin# nano config.inc.php

  
5. Authentication type のパスワードを変更する。
編集後は、control+x -> Y -> Enter で上書き保存が完了。
※auth_typeをcookieにするとID,password入力になる。

config.inc.php
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '{設定したパスワード}';

 

最後に

壁にぶつかってる人は、おそらくFinderからterminalを開いて../xampp/volumes/root/phpmyadminにてconfig.inc.phpを編集していることが推測される。

macでのXWAMPP環境は、そもそも仮想環境下で動作するのだから起点となる設定ファイルは、root@debian権限で行われなくてはならない。

質問サイトでもその前提が説明されていないので、イマイチ質問者と回答者が噛み合っていない事例が多々あった。
  

質問・不明点・間違いなどがあればご連絡ください。

  

8
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
5