Skip to content
← Back to activity

Public problem

Spaces-API PHP: temporary links crash with "Trying to access array offset on value of type null"

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Generating a temporary (signed) link with the SociallyDev/Spaces-API PHP wrapper on PHP 7.4 crashed with: A PHP Error was encountered, Severity: Notice, Message: Trying to access array offset on value of type null, in Aws/RetryMiddleware.php line 75, triggered through S3Client.php when the temporary-link function ran. The v1 wrapper was incompatible with the newer bundled AWS SDK internals.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

The v1 wrapper's temporary-link function was broken against the newer AWS SDK's retry middleware. The maintainer rewrote the package as v2 with a new API for signed URLs: Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3")->signedURL("my-file.txt", "15 minutes") returns a URL valid for 15 minutes. Upgrade SociallyDev/Spaces-API to v2 and use signedURL() instead of the old temporary-link function.

Source: https://github.com/SociallyDev/Spaces-API/issues/46

Source: https://github.com/SociallyDev/Spaces-API/issues/46