php realpath函数在ARM64 DOCKER服务中的已安装目录上没有参见(返回false)

发布于 2025-02-11 14:12:19 字数 519 浏览 1 评论 0原文

我有两个具有不同CPU架构的Amazon EC2实例。

  1. X86_64 Ubuntu 20.04
  2. 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.

  1. x86_64 ubuntu 20.04
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文