can you post the whole string of messages. also if you have whoops you can look at 'params' being passed from file to file and see which valuesare now booleans but were arrays before
Wondering why uploading works in php 7.3, but not in php 7.4 with Laravel 6
Currently using laravel/framework v6.9.0
I just updated my local dev environment from PHP 7.3.9 to PHP 7.4.0.
I have a snippet of code that grabs an avatar from Gravatar and then uploads that image to an S3 bucket.
The code looks like this (with an Unsplash image swapped for a Gravatar URL) .
use Illuminate\Support\Facades\Storage;
// Where to store this in the S3 bucket
$destination = 'users/file.jpg';
// The source file to grab
$source = 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?fit=crop&crop=faces&w=500&h=500';
// Optional stuff for AWS S3
$options = ['visibility' => 'private', 'Tagging' => 'collection=users&type=avatars'];
// Upload file
Storage::disk('s3')->put($destination, fopen($source, 'r'), $options);
In PHP 7.3.9 this workes perfectly, but in PHP 7.4.0, I get the following error:
PHP Notice: Trying to access array offset on value of type bool in /home/vagrant/project/vendor/league/flysystem/src/Util.php on line 276
I dug around in the flysystem files, but I'm not sure why this is not working. Can anyone help explain why this is happening and how I get this functionality working in 7.4.
@ralphmrivera Guzzle will be more reliable but add code complexity. I use file_get_contents sometimes in various apps (similar to fopen)... you just need to know that it can break in certain environments... probably best to use Guzzle.
Please or to participate in this conversation.