質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

XAMPP

XAMPP(ザンプ)は、ウェブアプリケーションの実行に必要なフリーソフトウェアをパッケージングしたApacheディストリビューションです。 XAMPPひとつインストールするだけで、Apache、MySQL、PHP、Perlなどのソフトウェアと、 phpMyAdminなどの管理ツール、SQLiteなどのソフトウェアやライブラリモジュールなどを利用することが可能です。

Q&A

解決済

2回答

3048閲覧

config.inc.phpを保存できない

helloo

総合スコア11

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

phpMyAdmin

phpMyAdminはオープンソースで、PHPで書かれたウェブベースのMySQL管理ツールのことです。

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

XAMPP

XAMPP(ザンプ)は、ウェブアプリケーションの実行に必要なフリーソフトウェアをパッケージングしたApacheディストリビューションです。 XAMPPひとつインストールするだけで、Apache、MySQL、PHP、Perlなどのソフトウェアと、 phpMyAdminなどの管理ツール、SQLiteなどのソフトウェアやライブラリモジュールなどを利用することが可能です。

0グッド

0クリップ

投稿2020/09/15 04:53

編集2020/09/15 06:12

前提・実現したいこと

**実現したいこと:**XAMPPを使用してWordpressの環境をローカルに構築

参考ページ
参考ページ1
参考ページ2

発生している問題・エラーメッセージ

発生している問題
config.inc.phpにてDBで設定したパスワードを入力し、保存を試みると以下のようなエラーメッセージがVSCodeから通告されます。

vscode

1'config.inc.php' の保存に失敗しました: アクセス権限が不十分です。[Sudo 権限で再試行] を選択してスーパーユーザーとして再試行してください。

Sudo権限で再試行」を選択すると次のようなエラーメッセージが表示されます。

vscode

1'config.inc.php' の保存に失敗しました: Command failed: "/private/var/folders/hv/9nhdd8tj7n76vf9xpqmgyqkm0000gn/T/AppTranslocation/BCC74AFF-2CF4-49DA-AF2F-E8953385EBF8/d/Visual Studio Code.app/Contents/Resources/app/bin/code" --file-write "/var/folders/hv/9nhdd8tj7n76vf9xpqmgyqkm0000gn/T/code-elevated-uxyuck" "/Users/yoshizawatakamasa/.bitnami/stackman/machines/xampp/volumes/root/phpmyadmin/config.inc.php" Error using --file-write: EACCES: permission denied, open '/Users/yoshizawatakamasa/.bitnami/stackman/machines/xampp/volumes/root/phpmyadmin/config.inc.php'

該当のソースコード

以下のファイルの
$cfg['Servers'][$i]['password'] = '';の部分にDBで設定したパスワードを入力し、保存を試みると先出のエラーメッセージが表示されます。

xampp/phpmyadmin/config.inc.php

php

1<?php 2/* vim: set expandtab sw=4 ts=4 sts=4: */ 3/** 4 * phpMyAdmin sample configuration, you can use it as base for 5 * manual configuration. For easier setup you can use setup/ 6 * 7 * All directives are explained in documentation in the doc/ folder 8 * or at <https://docs.phpmyadmin.net/>. 9 * 10 * @package PhpMyAdmin 11 */ 12declare(strict_types=1); 13 14/** 15 * This is needed for cookie based authentication to encrypt password in 16 * cookie. Needs to be 32 chars long. 17 */ 18$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */ 19 20/** 21 * Servers configuration 22 */ 23$i = 0; 24 25/** 26 * First server 27 */ 28$i++; 29/* Authentication type */ 30$cfg['Servers'][$i]['auth_type'] = 'config'; 31$cfg['Servers'][$i]['user'] = 'root'; 32$cfg['Servers'][$i]['password'] = ''; 33/* Server parameters */ 34//$cfg['Servers'][$i]['host'] = 'localhost'; 35$cfg['Servers'][$i]['compress'] = false; 36$cfg['Servers'][$i]['AllowNoPassword'] = true; 37 38/** 39 * phpMyAdmin configuration storage settings. 40 */ 41 42/* User used to manipulate with storage */ 43// $cfg['Servers'][$i]['controlhost'] = ''; 44// $cfg['Servers'][$i]['controlport'] = ''; 45$cfg['Servers'][$i]['controluser'] = 'pma'; 46$cfg['Servers'][$i]['controlpass'] = ''; 47 48/* Storage database and tables */ 49$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; 50$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; 51$cfg['Servers'][$i]['relation'] = 'pma__relation'; 52$cfg['Servers'][$i]['table_info'] = 'pma__table_info'; 53$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; 54$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; 55$cfg['Servers'][$i]['column_info'] = 'pma__column_info'; 56$cfg['Servers'][$i]['history'] = 'pma__history'; 57$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; 58$cfg['Servers'][$i]['tracking'] = 'pma__tracking'; 59$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; 60$cfg['Servers'][$i]['recent'] = 'pma__recent'; 61$cfg['Servers'][$i]['users'] = 'pma__users'; 62$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; 63$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; 64$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; 65$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; 66$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords'; 67$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; 68$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; 69$cfg['Servers'][$i]['favorite'] = 'pma__favorite'; 70// $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; 71// $cfg['Servers'][$i]['users'] = 'pma__users'; 72// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; 73// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; 74// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; 75// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; 76// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; 77// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; 78 79/** 80 * End of servers configuration 81 */ 82 83/** 84 * Directories for saving/loading files from server 85 */ 86$cfg['UploadDir'] = ''; 87$cfg['SaveDir'] = ''; 88 89/** 90 * Whether to display icons or text or both icons and text in table row 91 * action segment. Value can be either of 'icons', 'text' or 'both'. 92 * default = 'both' 93 */ 94//$cfg['RowActionType'] = 'icons'; 95 96/** 97 * Defines whether a user should be displayed a "show all (records)" 98 * button in browse mode or not. 99 * default = false 100 */ 101//$cfg['ShowAll'] = true; 102 103/** 104 * Number of rows displayed when browsing a result set. If the result 105 * set contains more rows, "Previous" and "Next". 106 * Possible values: 25, 50, 100, 250, 500 107 * default = 25 108 */ 109//$cfg['MaxRows'] = 50; 110 111/** 112 * Disallow editing of binary fields 113 * valid values are: 114 * false allow editing 115 * 'blob' allow editing except for BLOB fields 116 * 'noblob' disallow editing except for BLOB fields 117 * 'all' disallow editing 118 * default = 'blob' 119 */ 120//$cfg['ProtectBinary'] = false; 121 122/** 123 * Default language to use, if not browser-defined or user-defined 124 * (you find all languages in the locale folder) 125 * uncomment the desired line: 126 * default = 'en' 127 */ 128//$cfg['DefaultLang'] = 'en'; 129//$cfg['DefaultLang'] = 'de'; 130 131/** 132 * How many columns should be used for table display of a database? 133 * (a value larger than 1 results in some information being hidden) 134 * default = 1 135 */ 136//$cfg['PropertiesNumColumns'] = 2; 137 138/** 139 * Set to true if you want DB-based query history.If false, this utilizes 140 * JS-routines to display query history (lost by window close) 141 * 142 * This requires configuration storage enabled, see above. 143 * default = false 144 */ 145//$cfg['QueryHistoryDB'] = true; 146 147/** 148 * When using DB-based query history, how many entries should be kept? 149 * default = 25 150 */ 151//$cfg['QueryHistoryMax'] = 100; 152 153/** 154 * Whether or not to query the user before sending the error report to 155 * the phpMyAdmin team when a JavaScript error occurs 156 * 157 * Available options 158 * ('ask' | 'always' | 'never') 159 * default = 'ask' 160 */ 161//$cfg['SendErrorReports'] = 'always'; 162 163/** 164 * You can find more configuration options in the documentation 165 * in the doc/ folder or at <https://docs.phpmyadmin.net/>. 166 */ 167

試したこと

試したこと1
参考ページ1
参考ページ2
上記のページを参考にphpmyadminのアクセス権に自分のアカウントの追加を試しました。
しかし、必要なアクセス権がないため、操作は完了できません。と表示されました。

試したこと2
参考ページ1
参考ページ2
上記のページを参考に
sudo chmod -R 777 /Users/yoshizawatakamasa/.bitnami/stackman/machines/xampp/volumes/root/phpmyadmin/config.inc.php
とコマンド入力をしました。

至らぬ点は多々あるかとは思いますが、お力添えいただければ幸いです。
よろしくお願いいたします。

補足情報(FW/ツールのバージョンなど)

php 7.4.6
mysql Ver8.0.19
macos 10.15.6

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hentaiman

2020/09/15 05:17

参考ページmacだけど、使ってるOSもmacで合ってますか?
helloo

2020/09/15 05:40

はい!情報足らずですみません。自分もmacです。
hentaiman

2020/09/15 05:44

macのvscodeの「Sudo 権限で再試行」は試しましたか?Mac持ってないので分からないですが。それともsudoで再試行自体が出来ない状態ですか?
helloo

2020/09/15 05:49

はい。「Sudo 権限で再試行」すると二つ目のエラーメッセージが表示される状態です。
hentaiman

2020/09/15 06:00

ではなくて、sudo(管理者権限)でvscodeを実行は試しましたか?という質問です。
helloo

2020/09/15 06:04

失礼しました。管理者権限でvscodeを試す方法がわからないので現在調べており、まだ実行はできてない状況です。
hentaiman

2020/09/15 06:06

質問文で書かれているchmodですが、ファイルのパスは合っていますか? 記載ミスなだけかもしれませんが、頭のスラッシュとか他にも間違いあったりりませんか? 「ls ファイルパス」でちゃんと表示されるかどうか
helloo

2020/09/15 06:10

はい。質問分では`Users`の手前の/が抜けていますが、/をつけて実行しても、 `Operation not permitted`と表示されます。
hentaiman

2020/09/15 06:15

その後に書いた内容にも答えてください。ファイルが実在するかの確認です。 その表示だけで分かる事なのかもしれませんが、自分はmac持ってないので質問に答えてもらえないと分かんないんです。
helloo

2020/09/15 06:19

失礼しました。lsコマンドを打つとファイルが存在することを確認できます。
guest

回答2

0

ベストアンサー

sudo code /Users/yoshizawatakamasa/.bitnami/stackman/machines/xampp/volumes/root/phpmyadmin/config.inc.php
としてみてください。

投稿2020/09/15 06:24

hentaiman

総合スコア6415

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

helloo

2020/09/15 06:32

回答ありがとうございます。 回答していただいたコマンドを実行したのですが、 `sudo: code: command not found` と表示されました。 また、質問文にも記載した777の部分を775に変更、削除等を行いましたが同じエラーメッセージが表示されました。
hentaiman

2020/09/15 06:37

sudoつけないでcodeと打てばvscode開きますか?
helloo

2020/09/15 06:41

sudoをつけず実行すると `zsh: command not found: code` と表示されます。
helloo

2020/09/15 06:41

vscodeは開きません。
hentaiman

2020/09/15 06:45

なるほど、パス通ってないのか macのvscodeのパスの通し方が https://qiita.com/dz_/items/5a6e3813cf42b8d17fbf にあったので真似てみてください。バージョン違うかもしれないからその辺自分の環境に合わせてうまく解釈して。
helloo

2020/09/15 06:52

ありがとうございます。教えていただいたページを真似してcodeコマンドからvscodeを呼び出すことはできるようになりました。しかし、先ほどのコマンドを入力しても同じく`chmod: Unable to change file mode on /Users/yoshizawatakamasa/.bitnami/stackman/machines/xampp/volumes/root/phpmyadmin/config.inc.php: Operation not permitted`と表示されました。
hentaiman

2020/09/15 06:55

先ほどのコマンドと言うのはsudo code~~~の事ですか?
helloo

2020/09/15 07:02

はい!回答いただいたコマンド及び、投稿したコマンドも試しました。
hentaiman

2020/09/15 07:06

エラー調べたら新しくmacに追加されたセキュリティ機能らしいですね コマンドの問題じゃないみたいです。以下出てきたんで参考にしてみてください。 https://qiita.com/KEINOS/items/0366f1c281b574a79cfb 残念ながらmacに限った動作不具合となるとちょっと自分には分からんのでこれで回答終わりです。 これ解消してまだ問題起きてたら(エラーメッセージ変わってたら)改めてコメントください。
helloo

2020/09/15 07:34

掲載していただいたページ通りのことを実行しましたが、変化がありませんでした。 回答ありがとうございました。
hentaiman

2020/09/15 07:40

いやいや、そのエラー内容はSIPが原因らしいから対応するしか無いと思いますよ あえてセキュリティオフにする必要も無いかと思ってコメントには書きませんでしたが、オフにするだけならcsrutil disableと打てばいいみたいですよ。
guest

0

できるかはわからないけど、VSCodeを管理者権限で起動して編集。
確実なのは管理者権限でメモ帳を起動して編集。

投稿2020/09/15 05:06

編集2020/09/15 05:06
kyoya0819

総合スコア10429

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問