PHP realpath function doesn't see (returns false) on the mounted directory in the arm64 docker service

226 Views Asked by At

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.

0

There are 0 best solutions below