After installing the S3 SDK via composer as explained here the app breaks. I get "Couldn't reach API" on the login screen.
PHP Error log:
PHP Fatal error: Uncaught Error: Call to undefined function Directus\get_api_project_from_request() in /Users/seb/Code/directus7/src/web.php:16
Stack trace:
#0 /Users/seb/Code/directus7/public/index.php(3): require()
#1 {main}
thrown in /Users/seb/Code/directus7/src/web.php on line 16
I don't get any other error message in directus logs. I'm on an MAMP environment.
Login and storage adapter working
unable to login
master branch]After debugging this, which was also reported here #606, the problem is that the build version in directus/directus doesn't include the composer.json file and when something is installed using composer the autoload is rewritten, removing all directus composer prs4 autoloading, removing all directus libraries from composer autoload.
I believe the proper way to fix this is to include the composer.json into the directus build repository.
ping @rijkvanzanten
Is there any other way to fix it? I want to use s3 for upload image.
@subicura I worked around this issue by grabbing https://raw.githubusercontent.com/directus/api/master/composer.json and putting it in the root directory of the directus/directus repo, then running the command. I also found that you need to install flysystem, like with Directus 6, although that may be unrelated to this issue.
@subicura, what @computerwizjared suggest is the way to go.
composer.json to your root directory.require aws/aws-sdk-phpcomposer installEverything should run normally.
Is that in the docs? @WellingGuzman
I had to run the command composer require league/flysystem-aws-s3-v3 as well
It works! Thanks a lot!
Is that in the docs? @WellingGuzman
no, this should be fixed in directus/directus, it's missing the composer.json. When that's done, it doesn't need those steps.
I had to run the command
composer require league/flysystem-aws-s3-v3as well
Thanks for pointing it out, it needs the league/flysystem-aws-s3-v3 package instead of aws/aws-sdk-php.
Closed this ticket in favor of https://github.com/directus/directus/issues/2273
@wellingguzman Should #2 be composer require aws/aws-sdk-php?
@adamjgrant This issue is pretty old, and Welling has moved on from the project long since. If you're having any issues now, I recommend opening a new issue
how do i install a directus for windows? Please help
Most helpful comment
@subicura, what @computerwizjared suggest is the way to go.
composer.jsonto your root directory.require aws/aws-sdk-phpcomposer installEverything should run normally.