windows和unix路径的区别 [英] Difference between windows and unix paths

查看:63
本文介绍了windows和unix路径的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的测试服务器是 windows.实时服务器是 unix.

My test server is windows. Live server is unix.

我使用的是相对路径,这似乎对两者的作用相同.我改成绝对路径了,好像两者不一样.

I was using relative paths, which seemed to work identically on both. I changed to absolute paths and it seems the two are different.

我的问题源于从子目录加载的文件.在 Windows 服务器上,我使用 realpath(),这似乎给了我一个root"来定位.但 Unix 对此有何不同?

My problem stems from files being loaded from subdirectories. On the windows server I am using realpath(), and this seems to give me a 'root' to locate from. But unix treats this different?

将 unix 绝对路径匹配到 windows 的常用方法是什么?

What is the usual method of matching unix absolute paths to windows?

发现问题:原因是require().

似乎windows允许'多余的''/'前缀,所以

It seems windows permits a 'superfluous' '/' prefixed, so

require '/ajax/test.php' 在 windows 上有效,但在 unix 上无效.

require '/ajax/test.php' is valid on windows but not on unix.

推荐答案

问题发现:原因是 require().

Problem Found : The cause was require().

似乎windows允许一个多余的'/'前缀,所以

It seems windows permits a superfluous '/' prefixed, so

require '/ajax/test.php'` 在 Windows 上被接受,但 unix 返回错误.

require '/ajax/test.php'` is accepted on windows but unix returns an error.

这篇关于windows和unix路径的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆