Skip to content

phar file tries to load internal file from the wrong path #17293

Open
@roeycohen

Description

@roeycohen

Description

Hi,
On our servers, we launch multiple instances of our product in separate directories.
Last week, we've upgraded instance B and a phar file with the same name as in instance A was replaced with a newer version.

This caused system A to throw an error:
Error:
Failed opening required 'phar:///var/www/html/B/lib/external/aws-3.222.19.phar/Aws/functions.php' (include_path='.:/usr/local/lib/php')
File:
phar:///var/www/html/B/lib/external/aws-3.222.19.phar/aws-autoloader.php:1845

the trace from A shows the following:

{
	"call": "require()",
	"file": "/var/www/html/A/lib/external/aws-3.222.19.phar:4"
},
{
	"call": "require_once(\"/var/www/html/A/lib/external/aws-3.222.19.phar\")",
	"file": "/var/www/html/A/lib/storage/StorageS3.class.php:15"
}

That's really weird... like the aws-autoloader.php inside the PHAR file in A was trying to access a file in B's Phar (which was removed).
I thought maybe it has something to do with opcache, but use_cwd is turned on
..

here's the configuration from the deployment:
phar
opcache1
opcache2

let me know if you need anything else from me...
Thanks!!

PHP Version

PHP 8.1.29

Operating System

docker php:8.1.29-cli-alpine3.20

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions