[CDB] AWS S3

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

First off, this is an extension in development; therefore, there is a high probability of it not working. ;) That is what makes this community great. We can discuss what works, what doesn't work, and how we can all help this open-source software be the best it can be. So, rather than tapping your foot why don't you keep digging for a solution? Creating extensions for phpBB is something I'm able to do in my spare time, not on anyone else's schedule.

Okay, so the issue that John connor reported is due to a combination of dashes/hyphens (-) in the name of the extension, which according to the Package Naming Conventions is not allowed. What I wasn't understanding is that my GitHub repository can have dashes/hyphens in it, just the extension itself cannot.

The presume another issue is the naming of the zip file (and subsequently the extracted directory). When you first download the zip file, it is named something like phpbb-extension-s3-master.zip. You must extract the files to a phpbb-extension-s3-master directory and then the directory must be renamed in a AustinMaddox/s3 structure.

Image

And lastly, the extension has an external dependency of the AWS PHP SDK...

composer.json

Code: Select all

"require": {
    "aws/aws-sdk-php": "^3.19.4",
    "composer/installers": "~1.0",
    "php": ">=5.5.0"
  },
I didn't realize that while in [BETA], I need to ask any testers to run php composer.phar install in the /ext/AustinMaddox/s3 directory to install the external dependency. I guess I assumed that phpBB did that automatically or something. Once the extension is finalized, that won't be the case because I'll just commit the vendor directory, but while in BETA that is what we'll have to do. There is a discussion in the forums here that explains that pretty well.

I tagged a new release, 0.1.2! Please go re-download it.

Let me know how it goes! Thanks for your patience. :P
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

Okay, thank you. I just would like responses when I ask and not have to wait around wondering if this extension will just die. I will do what you say latter on tonight and see what happens. Right now I'm on a shared account and plan on going VPS once I check out webmin in a Ubuntu server install locally so I can become familiar with it all. I hope I can install that dependency.

I do thank you for creating this extension. It's something I really would like to have since one of my forums is largely an image sharing forum.

How do I run php composer.phar install?
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

You can download and install Composer many ways. I would always suggest running things locally. You can follow the instructions at https://getcomposer.org for your particular environment.

I added a little bit of basic instruction in the README of the phpbb-extension-s3 project repository on GitHub.

In order to run php composer.phar install --dev, you have to have the PHP CLI installed and the composer.phar file downloaded from getcomposer.org. If you are running on Windows you can download the Composer-Setup.exe and run it. That will install `composer` globally so you can just do composer install --dev at a command prompt.

Essentially, because of the current status of this extension [BETA] you'll have to be a little bit knowledgeable about Composer dependency management to get it working. Otherwise, it might be best to wait for a more stable release where the dependencies will come packaged into the zip file.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

Okay, I installed composer for Xampp using the Windows installer. It says I need to run some command? What would that be?

I got an error once I activated the extension.

Fatal error: Class 'Aws\S3\S3Client' not found in C:\xampp\htdocs\new\ext\AustinMaddox\s3\event\main_listener.php on line 49

Not sure if that has anything to do with composer. Now I have to dig into the database and remove everything because my current forum install in Xampp is giving me this error:

Fatal error: Class 'AustinMaddox\s3\event\main_listener' not found in C:\xampp\htdocs\new\vendor\symfony\event-dispatcher\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.php on line 145
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

John connor wrote: Fatal error: Class 'Aws\S3\S3Client' not found in C:\xampp\htdocs\new\ext\AustinMaddox\s3\event\main_listener.php on line 49
Yes, this is the error that tells you that the AWS PHP SDK is not installed. You have to run composer install at a command prompt from within the /ext/AustinMaddox/s3 directory. That will create the required dependencies and put them in the vendor folder at /ext/AustinMaddox/s3/vendor.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

I'm very noob with the command prompt. I'm using the Windows version of Composer. What is the command that I run? I installed composer and it found my php.exe automatically in the Xampp folder.

As you can see my phpBB install locally is in C:\xampp\htdocs\new\ext\AustinMaddox\s3\

Not sure what the command would be. Thanks for your help.

Edit- I can take a guess and say perhaps the command is composer C:\xampp\htdocs\new\ext\AustinMaddox\s3\?

When I type composer in CMD I get this:


Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\AAron>composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.2.1 2016-09-12 11:27:19

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as workin
g directory.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for norma
l output, 2 for more verbose output and 3 for debug

Available commands:
about Short information about Composer
archive Create an archive of this composer package
browse Opens the package's repository URL or homepage in your browser
.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Set config options
create-project Create new project from a package into given directory.
depends Shows which packages cause the given package to be installed
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader
dumpautoload Dumps the autoloader
exec Execute a vendored binary/script
global Allows running commands in the global composer dir ($COMPOSER_
HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser
.
info Show information about packages
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file
if present, or falls back on the composer.json.
licenses Show information about licenses of dependencies
list Lists commands
outdated Shows a list of installed packages that have updates available
, including their latest version.
prohibits Shows which packages prevent the given package from being inst
alled
remove Removes a package from the require or require-dev
require Adds required packages to your composer.json and installs them

run-script Run the scripts defined in composer.json.
search Search for packages
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Show information about packages
status Show a list of locally modified packages
suggests Show package suggestions
update Updates your dependencies to the latest version according to c
omposer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock
why Shows which packages cause the given package to be installed
why-not Shows which packages prevent the given package from being inst
alled
Would it be:

composer require C:\xampp\htdocs\new\ext\AustinMaddox\s3\?


Edit 2-

Got an error.
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\AAron>composer require C:\xampp\htdocs\new\ext\AustinMaddox\s3


[UnexpectedValueException]
Could not parse version constraint \xampp\htdocs\new\ext\AustinMaddox\s3: I
nvalid version string "\xampp\htdocs\new\ext\AustinMaddox\s3"


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
[--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform
-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-auto
loader] [-a|--classmap-authoritative] [--] [<packages>]...


C:\Users\AAron>
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

You need to "change directory" cd into the s3 extension directory.

cd C:\xampp\htdocs\new\ext\AustinMaddox\s3\
And then...
composer install
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

Thank you! Now we are getting somewhere. This is what I have.


Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\AAron>cd C:\xampp\htdocs\new\ext\AustinMaddox\s3\

C:\xampp\htdocs\new\ext\AustinMaddox\s3>composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing composer/installers (v1.2.0)
Downloading: 100%

- Installing mtdowling/jmespath.php (2.3.0)
Downloading: 100%

- Installing guzzlehttp/promises (1.2.0)
Downloading: 100%

- Installing psr/http-message (1.0.1)
Downloading: 100%

- Installing guzzlehttp/psr7 (1.3.1)
Downloading: 100%

- Installing guzzlehttp/guzzle (6.2.1)
Downloading: 100%

- Installing aws/aws-sdk-php (3.19.12)
Downloading: 100%

aws/aws-sdk-php suggests installing aws/aws-php-sns-message-validator (To valida
te incoming SNS notifications)
aws/aws-sdk-php suggests installing doctrine/cache (To use the DoctrineCacheAdap
ter)
Writing lock file
Generating autoload files

C:\xampp\htdocs\new\ext\AustinMaddox\s3>
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

Okay, I think I did everything correct. I created a group, added a user to that group, got the access key and secret access key and added that Info to the extension's settings in the ACP. But I have a parse error trying to upload.


http://imgur.com/6OjWkxU



Looks like a Cert issue. This is what I have in php_error_log.

#0 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Ha ndler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) 11 #1 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Ha ndler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlMultiHa in C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor \aws\aws-sdk-php\src\WrappedHttpHandler.php on line 192[03-Oct-2016 02:39:54 Europe/Berlin] PHP Fatal error: Uncaught exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "PutObject" on "https://s3-us-west-2.amazonaws .com/upload-3456/2_99c2a74bdc206aeae145e2870f483e69"; AWS HTTP error: cURL error 60: SSL certificate problem: unable t o get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' 12 13 exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to g et local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\new\ext\Austin Maddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 14 Stack trace: 15 #0 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Ha ndler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) 16 #1 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Ha ndler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlMultiH in C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\ aws\aws-sdk-php\src\WrappedHttpHandler.php on line 192[03-Oct-2016 04:06:41 Europe/Berlin] PHP Fatal error: Uncaught exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "PutObject" on "https://s3-us-west-2.amazonaws. com/upload-3456/2_f7bece3683a0d97198347ab23eca1c89"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' 17 18 exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to g et local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\new\ext\Austin Maddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187 19 Stack trace: 20 #0 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Ha ndler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) 21 #1 C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Ha ndler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlMultiH in C:\xampp\htdocs\new\ext\AustinMaddox\s3\vendor\ aws\aws-sdk-php\src\WrappedHttpHandler.php on line 192
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

Can you go re-download the latest code please? I put in a fix for that.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

austin881 wrote:Can you go re-download the latest code please? I put in a fix for that.

Will do! Thanks! Will see what happens now and I'll report back.

Edit- I think Github is down. Got this message with a unicorn.
No server is currently available to service your request.

Sorry about that. Please try refreshing and contact us if the problem persists.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

I'm glad to report so far everything seems to be working! There are no errors in php_error_log, no errors in the ACP or errors in the FTP for error_log or error.log. So this is good. I do have a slight hiccup with the extension I have called Lightbox I think it's called. The image should pop out, but the clamp seems to mess with that ability. I do have an older version installed I think, but I'll have to contact the author on that one. It's not that big a deal.

Question: Since I added the necessary dependencies with Composer in Windows to the S3 folder, can I safely use this extension with those Composer AWS dependencies on my live site for testing? I wouldn't think there would be an issue, but just wanted to make sure.

If anyone needs SSL from the bucket, I found this. I haven't tried this yet since I haven't tested this extension on my live site yet. https://engagingcomms.com.au/easy-way-t ... loudflare/
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
austin881
Registered User
Posts: 287
Joined: Wed Jan 30, 2008 9:58 pm
Location: Texas, USA
Name: Austin Maddox

Re: [BETA] AWS S3

Post by austin881 »

Great to hear it is working for you! Yes, you could theoretically use this extension on your live environment site for testing. As long as you bring the vendor folder along it should just work. All that composer install command does is create the vendor folder with everything you need in there.

Disclaimer: At this point in the development of this extension I must advise against using this in production. Note that John connor asked if this extension could be used "for testing" in a live environment, not for actual production usage.

Not sure about the Lightbox issue. If you could provide more details, contact the extension author, and explain to me what a "clamp" is, we can discuss it further.
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

Hi. What I mean by "clamp" is the word you used to describe how this extension works. In that the EXT claps onto the attachment.

The EXT that has just a minor issue is called Lightbox by VSE. What happens is that the image lightbox pops out like shown in this image, but in addition opens a new tab and shows the image.

http://i.imgur.com/5zDAxkr.jpg

http://imgur.com/a/k09jS


It's not that big of a deal, but might be something VSE wants to look at. I'll let him know.
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:
User avatar
2600
I've Been Banned!
Posts: 2567
Joined: Fri Nov 14, 2014 5:14 pm
Location: Area-51

Re: [BETA] AWS S3

Post by 2600 »

How does this extension store the amazonaws links? I can't seem to find any reference to the links in the database at all which leads me to believe the links are hashed or are changed to something else. And the only reference I can find in the database for my bucket name is in php_config.

Question: When I update this extension, do I have to delete the data, or can I just disable the EXT and upload the new version?

EDIT-


Well, I was going to give this a test on my live site and I simply uploaded the extension to the FTP and my site didn't want to load. Removed this extension and the site loaded. Looking at error_log I see this:

[06-Oct-2016 04:35:02 America/Chicago] PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in /home/USERNAME/public_html/mysite/ext/AustinMaddox/s3/vendor/aws/aws-sdk-php/src/functions.php on line 36
Morpheus: Unfortunately, no one can be told what The Matrix is. You'll have to see it for yourself.
Hack me.
Consider a canary token.
The nature of my chosen username
:ugeek:

Return to “Extensions in Development”