php realpath函数在ARM64 DOCKER服务中的已安装目录上没有参见(返回false)
我有两个具有不同CPU架构的Amazon EC2实例。
- X86_64 Ubuntu 20.04
- ARM64 Ubuntu 22.04
都在运行相同的Docker服务。但是,每个服务均基于相应的CPU架构Docker映像。
我以相同的方式将几个目录从Localhost载入了Docker服务。
当我运行PHP功能时:
realpath('../tmp');
它适用于X86_64服务,但它不适用于ARM64。
我不确定CPU体系结构是否会影响,但这是它们之间的唯一区别。
更新:
当我运行Linux命令真实路径时:
/var/www/html/public# realpath ../tmp
我会得到正确的路径:
/var/www/html/tmp
对于两个实例/服务,PHP配置也相同。
I have two amazon EC2 instances with different CPU architectures.
- x86_64 ubuntu 20.04
- arm64 ubuntu 22.04
Both are running the same docker service. However, each service is based on the corresponding CPU architecture docker image.
I've mounted a few directories from the localhost to the docker service for both instances the same way.
And when I run the PHP function like:
realpath('../tmp');
It works for the x86_64 service but it doesn't work for the arm64.
I'm not sure if the CPU architecture affects but this is the only difference between them.
Update:
When I run the Linux command realpath:
/var/www/html/public# realpath ../tmp
I get the correct path:
/var/www/html/tmp
And the PHP config is also the same for both instances/services.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论