MAC OSXでXAMPPのルートディレクトリを変更します



Change Root Directory Xampp Mac Os X



XAMPPは、PHP開発環境に必要なApacheとMysqlの基本コンポーネントを統合します。ただし、システムに付属するルートディレクトリは/ Applications / XAMPP / htdocsです。 Webサイトのルートをカスタムディレクトリフォルダに置き換えたい場合があります。以下の方法で達成できます

  • 1アプリケーションを開きます-> XAMPP-> xamppfiles->など-> httpd.confドキュメント
  • 2 commond + f search htdocs、次の結果が見つかりました
# DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot '/Applications/XAMPP/xamppfiles/htdocs'
  • 3DocumentRootとDirectoryのパスを目的のパスに変更します。 2つのパスは同じである必要があります。

Macの一部のフォルダには、ローカルユーザーへの読み取りおよび書き込みアクセスのみがあります。サーバーがそのようなフォルダーにアクセスすると、禁止が表示されます。解決策は次のとおりです。



Commond + fはユーザー/グループを検索し、次の結果を見つけます

# User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon

ユーザーを自分のユーザー名に変更します。読み取りおよび書き込み権限を取得するため