windows 如何使我的本地服务器区分大小写?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3582845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I make my local server case-sensitive?
提问by Moe Sweet
I'm on Windows Vista Home Premium 64 bit OS. I use Apache Friends XAMPP server as my localhost. And I develop PHP, MySQL.
我使用的是 Windows Vista Home Premium 64 位操作系统。我使用 Apache Friends XAMPP 服务器作为我的本地主机。我开发PHP,MySQL。
The problem is my local server is tolerant of case mistakes, especially in file/folder names.
问题是我的本地服务器可以容忍大小写错误,尤其是在文件/文件夹名称中。
When that running program on my server goes on linux servers, it's really a headache to locate and correct all the case errors.
当我服务器上正在运行的程序运行在 linux 服务器上时,定位和纠正所有大小写错误真的很头疼。
So how can I make my local server case-sensitive as in linux servers?
那么如何让我的本地服务器像在 linux 服务器中一样区分大小写?
采纳答案by Lekensteyn
No you can't. PHP file handling is dependant on the underlying O. Since Windows is a case-insensitive OS, it cannot handle files with a different case.
不,你不能。PHP 文件处理依赖于底层 O。由于 Windows 是不区分大小写的操作系统,因此它无法处理具有不同大小写的文件。
This won't change, as it will break a lot of applications. NTFS is a case-sensitive filesystem according to this KB article.
这不会改变,因为它会破坏很多应用程序。根据这篇知识库文章,NTFS 是区分大小写的文件系统。
If you have an old PC doing nothing, install a Linux server on it. Or if you have enough resources (RAM), run a Virtual machine (with VirtualBoxfor example)
如果您有一台旧电脑,什么都不做,请在其上安装 Linux 服务器。或者,如果您有足够的资源 (RAM),请运行虚拟机(例如使用 VirtualBox)
回答by Youssef
case-sensitivity is not due to the web server it self, but to the operating system. Linux is case-sensitive not windows. As far as i know, you can't make windows case-sensitive.
区分大小写不是由于 Web 服务器本身,而是由于操作系统。Linux 区分大小写,而不是 Windows。据我所知,你不能让 windows 区分大小写。
but try yo keep all your folders/files lowercase, this will save you much headeach when moving to linux production server.
但是尝试将所有文件夹/文件保持小写,这将在转移到 linux 生产服务器时为您节省很多麻烦。