aws / aws-sdk-php-zf2

ZF2 module for using the AWS SDK for PHP to interact with AWS services like S3, DynamoDB, SQS, EC2, etc.
http://aws.amazon.com/sdkforphp/
Apache License 2.0
103 stars 63 forks source link

module not working ... #8

Closed seth9009 closed 11 years ago

seth9009 commented 11 years ago

Hi,

I have installed the module but not via composer i simply download it and copy it to my vendor folder also downloaded the guzzle and the AWS SDK however everything stops when i try to use it, and it stops right after this line

$aws = $this->getServiceLocator()->get('Aws');

no error message just this generic one:

An error occurred An error occurred during execution; please try again later.

P.S. i have also renamed the directory from aws-sdk-php-zf2 to simply aws

if anyone has an idea of what would may be i would really appreciate a little help, thx! :)

jeremeamia commented 11 years ago

The SDK and Guzzle also depend on the Symfony2 Event Dispatcher. If you are trying to install the module without Composer, it is likely that you are missing this. If you can't use Composer, you can download the AWS SDK for PHP and all of it's required and optional dependencies here. You can remove Doctrine\Cache, Psr\Log, and Monolog if you do not plan to use them.

seth9009 commented 11 years ago

Thank you for your reply! really appreciate it, however it did not solve the problem :( i have downloaded the sdk from the link you provided but i still get the same generic error message ... if you have other idea i would love to know about it .. in the mean time i'll try more to see if i can get a hang of it ..

jeremeamia commented 11 years ago

Interesting. Does the rest of you application work? Is ZF2 configured correctly? I'm not sure what else I can do to help you debug. Where did you put the the SDK and module within your ZF2 project? Can you change the error reporting level of PHP and/or ZF2 to output more information about what is going wrong?

seth9009 commented 11 years ago

Yes everything else works just fine, and ZF2 is configured correct, the error appear only when i try to add something and and it stops right at this line

$aws = $this->getServiceLocator()->get('aws');

the error_reporting is ini_set('error_reporting', E_ALL);

i have put all modules in vendor directory and it looks like this

vendor

application.config.php looks like this

'modules' => array(
    'Application',
    'Collection',
    'ZfcAdmin',
    'Aws'
),
seth9009 commented 11 years ago

hmm .. it did not take the tabs to see how i have it in vendor ...

seth9009 commented 11 years ago

vendor

application.config.php looks like this 'modules' => array( 'Application', 'Collection', 'ZfcAdmin', 'Aws' ),

jeremeamia commented 11 years ago

That structure looks correct. Without getting more information about the error, I'm just not sure what to try next. Since you are not using Composer, I really don't know if things are getting loaded or wired up correctly. I'm definitely not a ZF2 expert, so maybe someone else in the ZF2 community might have better insight into what could be going wrong or how to get more details about the error. @bakura10, do you have any ideas?

bakura10 commented 11 years ago

It looks indeed correct. BUT this is only the Aws SDK source code. Did you install the ZF 2 AWS module (those are two different things).

Try to organize them the same way as when using composer: the main SDK of AWS is called "aws-sdk-php" while the ZF 2 module is called "aws-sdk-php-zf2".

Note : is there a valid reason why you're not using Composer ? It would save you immediately all those hassle !

seth9009 commented 11 years ago

yes i have installed the aws-sdk-php-zf2 module too, there is no reason for not using composer, just wanted to be able to make it work without composer, i'm working on windows and working with composer on windows it's a nightmare :) at least on my PC, i have installed the module via composer under linux and works fine, but i just wanted to make it work without composer

the error it's 500 i managed to view it after i have installed the zenddevtools, anyway thx guys for your help! i'll try some more :)

bakura10 commented 11 years ago

Dependency is really a nightmare to handle as soon as you have complex graph (well this is not specific to PHP). I'm pretty sure it must be a auto loading problem but I think you'd better make composer works on Windows, it'll be easier lol :D.

Envoyé de mon iPhone

Le 27 mai 2013 à 14:47, seth9009 notifications@github.com a écrit :

yes i have installed the aws-sdk-php-zf2 module too, there is no reason for not using composer, just wanted to be able to make it work without composer, i'm working on windows and working with composer on windows it's a nightmare :) at least on my PC, i have installed the module via composer under linux and works fine, but i just wanted to make it work without composer

the error it's 500 i managed to view it after i have installed the zenddevtools, anyway thx guys for your help! i'll try some more :)

— Reply to this email directly or view it on GitHub.

jeremeamia commented 11 years ago

Closing this issue. We only support using the module via Composer.

harshal-obl commented 10 years ago

I am new to both php and Dynamodb , I have installed the skeletonzf2 and in the /vendor i have installed your git (via composer) I have copied the table creation index action into index action of Application module(default in skeleton) and changed other files as you have suggested in the Readme.md when i run the module it throws exception Zend\ServiceManager\Exception\ServiceNotFoundException Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for aws

Any light on the path would be helpful.

bakura10 commented 10 years ago

Hi,

Did you make sure you enable Aws module in your application.config.php?

Envoyé de mon iPhone

Le 7 déc. 2013 à 11:44, harshal-obl notifications@github.com a écrit :

I am new to both php and Dynamodb , I have installed the skeletonzf2 and in the /vendor i have installed your git (via composer) I have copied the table creation index action into index action of Application module(default in skeleton) and changed other files as you have suggested in the Readme.md when i run the module it throws exception Zend\ServiceManager\Exception\ServiceNotFoundException Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for aws

Any light on the path would be helpful.

— Reply to this email directly or view it on GitHub.

harshal-obl commented 10 years ago

Thank you for such quick reply, By default it has 'Application' as i have installed skeleton and i am making changes in that module only

bakura10 commented 10 years ago

You need to add "Aws". I suggest you to read the Zend framework application to learn more about how using modules.

Envoyé de mon iPhone

Le 7 déc. 2013 à 11:51, harshal-obl notifications@github.com a écrit :

Thank you for such quick reply, By default it has 'Application' as i have installed skeleton and i am making changes in that module only

— Reply to this email directly or view it on GitHub.

harshal-obl commented 10 years ago

I have created the module as you have suggested but still throws exception

My directory structure

zendpp is my main folder

zendapp /config/application.config.php zendapp/module/Aws Aws/config/module.config.php Aws/module.php Aws/src/Aws/Controller/IndexController.php Aws/view/Aws/index/inde.php zendapp/vendor/bin/ zendapp/vendor/composer/ zendapp/vendor/guzzle/ zendapp/vendor/symfony zendapp/vendor/zendframework zendapp/vendor/zf2 zendapp/vendor/aws/aws-sdk-php/ zendapp/vendor/aws-sdk-php-zf2/

Right now i am using dynamo local hopes that's not the problem (FYI have added base url to localhost in aws.local.php)

bakura10 commented 10 years ago

No no you should not create any module! The AWS module you downloaded is already a ZF2 module. What you need is simply activate it by adding the "Aws" value in the module list.

I REALLY suggest you to read about ZF2 applications first, it seems you are missing the basics here :)

Envoyé de mon iPhone

Le 7 déc. 2013 à 12:43, harshal-obl notifications@github.com a écrit :

I have created the module as you have suggested but still throws exception

My directory structure

zendpp is my main folder

zendapp /config/application.config.php zendapp/module/Aws Aws/config/module.config.php Aws/module.php Aws/src/Aws/Controller/IndexController.php Aws/view/Aws/index/inde.php zendapp/vendor/bin/ zendapp/vendor/composer/ zendapp/vendor/guzzle/ zendapp/vendor/symfony zendapp/vendor/zendframework zendapp/vendor/zf2 zendapp/vendor/aws/aws-sdk-php/ zendapp/vendor/aws-sdk-php-zf2/

Right now i am using dynamo local hopes that's not the problem (FYI have added base url to localhost in aws.local.php)

— Reply to this email directly or view it on GitHub.

harshal-obl commented 10 years ago

Thanks man after reading throughly i was able to complete it...thanks for your help @bakura10