XAMPP 中的 Eclipse 工作区作为 htdocs 在 Mac 中无法工作?
我今天买了一台 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方案是这样的:
希望有帮助。
The solution is this:
Hope that helps.
这很可能是权限问题。应用程序可能不会请求写入(或以某种方式控制)该目录的管理员权限,它可能只是默默地失败。通常,您需要提供管理员权限才能修改
/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 evenLibrary
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?这里的问题是该工作区被锁定。快速的解决方案是删除 /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.