xampp解决窗口路径参考问题
不久前我不得不重新格式化并重新安装 XP,效果非常好。
我的问题是直到今天我才重新安装 xampp(最新版本)。转到“localhost/project”效果很好。我可以看到该网站,但 css 和图像不起作用。本地主机正在将项目文件夹内的“/”路径引用作为根“htdocs”读取。
对于那些会提到它的人:我删除了 php 文件中的“/”,并且对样式的链接和引用工作正常,但在 css 文件中,任何“../”引用都失败了。
我认为前面的“/”是有原因的,但我已经忘记了。
大家有什么想法吗?我的搜索没有发现任何有用的东西。
I had to reformat and reinstall XP a while ago which works just dandy.
My issue is that I never re-installed xampp until today (newest version). Going to "localhost/project" works fine. I can see the site but css and images aren't working. Localhost is reading my "/" path references inside the project folders as root "htdocs".
For those who will mention it: I removed the "/" in my php files and the links and reference to styles worked fine, but within the css files, any "../" reference failed.
I think there was a reason for the preceeding "/", but I have since forgotten.
Any have any ideas? None on my searches turn up anything useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将旧的 xampp 安装复制到新 XP 上的同一路径中?如果没有,您可能必须更改 httpd.conf,因为 apache 使用其中的一些变量来计算相对路径。
您还可以尝试使用 Opera Dragonfly 或其他调试器来查看浏览器中的错误
did you copy your old xampp installation into the same path on your new XP? if not, you have to change the httpd.conf perhaps as apache uses some variables in there to calculate relative paths.
you could also try to use opera dragonfly or another debugger to see errors in your browser