## Problem/Motivation

Testing Flysystem 2.3.0 and Flysystem S3 3.0.0 on Drupal 11.3 with PHP 8.4 produces deprecation warnings during normal stream wrapper operations.

The warnings appear when interacting with S3-backed storage through the Flysystem stream wrapper.

Examples:

```text
Deprecated: League\Flysystem\Filesystem::get():
Implicitly marking parameter $handler as nullable is deprecated,
the explicit nullable type must be used instead.

Deprecated: League\Flysystem\FilesystemInterface::get():
Implicitly marking parameter $handler as nullable is deprecated,
the explicit nullable type must be used instead.

Deprecated: Codementality\FlysystemStreamWrapper\FlysystemStreamWrapper::register():
Implicitly marking parameter $configuration as nullable is deprecated,
the explicit nullable type must be used instead.
```

## Steps to reproduce

1. Drupal 11.3.x
2. PHP 8.4
3. Install:

* drupal/flysystem 2.3.0
* drupal/flysystem_s3 3.0.0
4. Configure an S3 stream wrapper.
5. Perform basic stream wrapper operations such as:

* file_put_contents('s3://...')
* file_get_contents('s3://...')
* scandir('s3://')

## Proposed resolution

Investigate PHP 8.4 compatibility of:

* league/flysystem
* codementality/flysystem-stream-wrapper

Determine whether updated upstream releases are available or whether compatibility patches are needed.

## Additional information

Functionality appears to work correctly despite the warnings. The issue is currently limited to PHP 8.4 deprecation notices observed during normal S3 stream wrapper usage.

Issue fork flysystem-3595097

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

w01f created an issue. See original summary.

mukeshaddweb made their first commit to this issue’s fork.

lisa.rae’s picture

Is the issue fork for version 2.3.x or version 3.0.x?

3.0.x just underwent a recent rewrite. Over the next few weeks branch 3.0.x will be reviewed and updated for coding standards compliance, and once an alpha release of the module is published, will be tested for php 8.4 compliance.

lisa.rae’s picture

Status: Active » Postponed (maintainer needs more info)
w01f’s picture

While upgrading a production Drupal 11.4 site from S3FS to Flysystem, we encountered a related issue that may be useful for this discussion.

After successfully migrating the site's existing s3:// stream wrapper from S3FS to Flysystem, all public requests began returning HTTP 500 errors under our PHP-FPM environment.

The root cause was traced to the codementality/flysystem-stream-wrapper dependency, specifically src/PosixUid.php, which assumes POSIX functions are always available. In our environment, PHP CLI exposed the POSIX extension, while PHP-FPM did not expose the same functions, resulting in fatal errors during normal web requests.

We isolated the issue, implemented a temporary Composer patch, and validated the fix on a live Drupal 11.4 production site. After applying the patch:

  • HTTP 500 errors were eliminated.
  • Existing s3:// stream wrappers continued functioning.
  • Existing media entities remained functional.
  • Image derivative generation remained functional.
  • Search API / OpenSearch continued operating normally.

Upstream links:

Once the upstream fix is merged and released, Flysystem can update its dependency and sites using the Drupal Flysystem module will benefit automatically.

Hopefully this helps anyone else migrating existing Drupal sites from S3FS to Flysystem on Drupal 11.x.

lisa.rae’s picture

Version: 3.0.x-dev » 2.3.x-dev
Status: Postponed (maintainer needs more info) » Needs work

This bug was filed for version 3.0.x, which underwent a complete rewrite that included removing the dependency for codementality/flysystem-stream-wrapper.

For version 3.0.x (including 3.0.0-alpha1)

Please upgrade to either the most recent 3.0.x-dev version or (preferabley) to 3.0.0-alpha1, both of which were released shortly after the rewrite to remove dependencies on codementality/flysystem-stream-wrapper from the codebase.

For versions 2.2.x / 2.3.x
Since this bug is still relevant to version 2.2.x/2.3.x, I’m changing the version dependency accordingly, keeping the bug open and marking it “Needs Work”.

Pleaset let me now if you have any questions.

lisa.rae’s picture

For the 8.4 / Drupal 12 deprecation issues for version 3.0x+, there is a separate issue open to address the deprecations. This issue will be kept open to address deprecations for version 2.3.x and version 2.2.x.

https://www.drupal.org/project/flysystem/issues/3601322

lisa.rae’s picture