PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 29, 2022

[FIXED] Class 'ZendService\Amazon\S3' not found even though it is installed via Composer

 January 29, 2022     amazon-s3, composer-php, php, zend-framework2     No comments   

Issue

My project is based on the Zend Skeleton App, and I'm using Composer to add vendor packages. However, when I add the zendservice-amazon package, it is not getting autoloaded.

Here is part of my composer.json file:

"require": {
    "php": ">=5.3.3",
    "zendframework/zendframework": "2.3.*",
    "zendframework/zendservice-amazon": "2.0.*",
    "doctrine/doctrine-orm-module": "0.7.*",
    "zf-commons/zfc-user-doctrine-orm": "dev-master"
}

I have looked at the autoload files in the vendor directory, and they include the ZendService\Amazon namespace. I've tried several different things, but it's not working.

I've double checked that composer's autoloader is being used, so this is really puzzling. Any ideas? Thanks in advance.


Solution

The documentation and examples are wrong in the Zend Framework documentation. Instead of:

$s3 = new \ZendService\Amazon\S3();

You need to add an extra "S3":

$s3 = new \ZendService\Amazon\S3\S3();


Answered By - Poldon
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing