S3 Upload "During inheritance of Countable" Error

Wappler Version : v6 beta 4
Server Model: PHP
Database Type: MySQL
Hosting Type: AWS Elastic Beanstalk with PHP 8.1

Expected behavior

When I convert my code from Wappler 3.9.7 to 6.0 beta 4, my S3 Upload function should still work.

Actual behavior

What actually happens?

It doesn’t.

After upgrading to v6 beta 4, I get the following error message:


"/var/app/current/dmxConnectLib/aws/Aws/HandlerList.php" line 32

"During inheritance of Countable: Uncaught ErrorException: 
Return type of Aws\\HandlerList::count() should either be 
compatible with Countable::count(): int, or the
 #[\\ReturnTypeWillChange] attribute should be used to 
temporarily suppress the notice in 
/var/app/current/dmxConnectLib/aws/Aws/HandlerList.php:308

Stack trace:\n#0 /var/app/current/dmxConnectLib/aws/Aws/HandlerList.php(32): exception_error_handler(8192, 'Return type of ...', '/var/app/curren...', 308)\n#1 /var/app/current/dmxConnectLib/aws/aws-autoloader.php(1463): require('/var/app/curren...')\n#2 /var/app/current/dmxConnectLib/aws/Aws/AwsClient.php(197): {closure}('Aws\\\\HandlerList')\n#3 /var/app/current/dmxConnectLib/aws/Aws/S3/S3Client.php(328): Aws\\AwsClient->__construct(Array)\n#4 /var/app/current/dmxConnectLib/modules/s3.php(32): Aws\\S3\\S3Client->__construct(Array)\n#5 /var/app/current/dmxConnectLib/lib/App.php(206): modules\\s3->provider(Object(stdClass), 's3', NULL)\n#6 /var/app/current/dmxConnectLib/lib/App.php(146): lib\\App->execSteps(Object(stdClass))\n#7 /var/app/current/dmxConnectLib/lib/App.php(172): lib\\App->exec(Object(stdClass), true)\n#8 /var/app/current/dmxConnectLib/lib/App.php(178): lib\\App->execSteps(Object(stdClass))\n#9 /var/app/current/dmxConnectLib/lib/App.php(146): lib\\App->execSteps(Array)\n#10 /var/app/current/dmxConnectLib/lib/App.php(135): lib\\App->exec(Object(stdClass), false)\n#11 /var/app/current/dmxConnectLib/lib/App.php(113): lib\\App->exec(Object(stdClass))\n#12 /var/app/current/dmxConnect/api/aws_s3/aws_s3_signup.php(8): lib\\App->define(Object(stdClass))\n#13 {main}"

I can provide access to the url and login where this can be seen if required.

Here is the code for the S3 Upload server action:

I had the same issue with a Wappler 3.9.7 / PHP 8.1 combo before, which is documented below… rather than try all these things again, I’d appreciate the latest info about the best way to approach the issue with a Wappler v6 code base!

Hi there @patrick!

Any thoughts on the best way forwards for me with this one?

Thanks!
Antony.

@Teodor, @patrick, I’d love a response to this please!

This is not really a beta related problem but a problem with AWS Sdk and probably their php 8 support.

To use the latest AWS module with their fixes you have to switch to use composer in your php project options and then it will be updated automatically

Thanks for that @george… I’m just installing it all now.

The documentation is missing a few screenshots… see below.

It also mentions this is a beta feature as of May 2023… it is still part of beta now?

Yippee… that worked… thanks @george! :tada: