XAMPP 中的 Eclipse 工作区作为 htdocs 在 Mac 中无法工作?

发布于 2024-10-05 02:31:19 字数 264 浏览 8 评论 0原文

我今天买了一台 MacBook Air(我已经从 PC 用户转换为 Mac),最近安装了 XAMPP 和 Eclipse for Mac,我尝试将 Eclipse 的工作区设置为 XAMPP 中的 htdocs 文件夹。我总是收到警告:

工作区正在使用或无法创建,请选择其他工作区!

我尝试设置的目录是 /Applications/XAMPP/htdocs

我一直在尝试设置另一个目录,只要它不是上面的目录,它就可以正常工作。我做错了什么?我想要上面的目录。请。帮助

I've bought a MacBook Air(I've been converted from a PC guy to a Mac) today and I have recently installed XAMPP and Eclipse for Mac and I try to set the workspace for Eclipse as the htdocs folder in XAMPP. I always get the warning:

Workspace in use or cannot be created, choose a different one!

The directory i try to set is /Applications/XAMPP/htdocs

I've been trying to set an another directory it works fine as long as it is not the one above. What have I done wrong? I want the directory above. Pls. help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无法回应 2024-10-12 02:31:19

解决方案是这样的:

  1. 进入 htdocs 文件夹并按 CMD+I 调出“获取信息”窗口
  2. 在此窗口中,转到右下角并单击挂锁图标,输入密码以解锁权限设置中的权限设置窗口
  3. 您将看到用户列表及其各自的权限。将“admin”的权限更改为“读和写”
  4. 再次单击挂锁以保存更改并锁定 htdocs 文件夹的权限
  5. 启动 Eclipse,然后选择 htdocs 作为您的工作区,
  6. 瞧!你完成了。

希望有帮助。

The solution is this:

  1. Go into the htdocs folder and hit CMD+I to bring up the "Get Info" window
  2. In this window, go to the bottom right and click on the padlock icon, enter your password to unlock the permissions settings in the window
  3. You'll see a list of users and their respective permissions. Change the "admin"'s permission to "Read & Write"
  4. Click the padlock once more to save your changes and lock the permissions for the htdocs folder
  5. Start up Eclipse and then select htdocs as your workspace, and
  6. Voila! You're done.

Hope that helps.

っ左 2024-10-12 02:31:19

这很可能是权限问题。应用程序可能不会请求写入(或以某种方式控制)该目录的管理员权限,它可能只是默默地失败。通常,您需要提供管理员权限才能修改 /Applications/ 下的任何内容。

无论如何,我不建议使用 /Applications/XAMPP/htdocs/ 作为工作区。您的工作区应该位于您的主目录中(Documents,甚至可能是 Library,尽管前者更直观),或者如果多个用户需要访问,则位于其他共享位置它。将其与应用程序本身捆绑在一起可能会在应用程序升级期间丢失数据,或者以其他方式混淆问题。

为什么您希望数据位于 /Applications/ 目录中?

It's likely a permissions issue. The application may not be requesting admin rights to write to (or in some way control) that directory, it may just be silently failing. Generally, you need to supply admin rights to modify anything under /Applications/.

I wouldn't recommend using /Applications/XAMPP/htdocs/ as your workspace anyway. Your workspace should either be in your home directory (Documents or perhaps even Library though the former would be more intuitive), or in some other shared location if multiple users need to access it. Bundling it with the application itself would risk losing the data during an application upgrade, or in some other way confusing the issue.

Why do you want your data in the /Applications/ directory?

夜未央樱花落 2024-10-12 02:31:19

这里的问题是该工作区被锁定。快速的解决方案是删除 /Applications/XAMPP/htdocs/.metadata/.lock

稍长的解决方案是每当出现这种情况时尝试以下命令:
find /Applications/XAMPP/htdocs -name "lock" -exec echo {} \;

这将显示该目录中名称已锁定的任何文件。请记住,隐藏文件以 . (例如 .lock 或 .metadata)。

更长的答案是 /Applications 位于用户空间之外,不应该用于用户文档(如代码文件)。理想情况下,应将它们移动到 /Users 中的某个位置或专门为此目的创建的目录(例如 /home 或 /shared)。我特别喜欢有一个 /Users/Shared 目录来在帐户之间共享文件。

The problem here is that this workspace is locked. The quick solution is to delete /Applications/XAMPP/htdocs/.metadata/.lock

The slightly longer solution is to try the following command whenever such a situation occurs:
find /Applications/XAMPP/htdocs -name "lock" -exec echo {} \;

This will show you any file in that directory that has lock in the name. Remember that hidden files start with a . (such as .lock or .metadata).

The even longer answer is that /Applications is outside of the userspace and should not be used for user documents (like code files). These should ideally be moved to somewhere in /Users or into a directory specifically created for this purpose (such as /home or /shared). I'm particularly fond of having a /Users/Shared directory for sharing files between accounts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文