Simple way for uploading file to Amazon S3

I have one project for uploading video file to Amazon S3 server on PHP environment.

To get started with sample, download sample project.

git clone https://github.com/awslabs/aws-php-sample.git

Go to aws-php-sample folder and run. This will install composer.

curl -sS https://getcomposer.org/installer | php
php composer.phar install

 

Create testing php script.

<?php
require 'vendor/autoload.php';

use Aws\Exception\AwsException;
use Aws\S3\Exception\S3Exception;

$s3 = new Aws\S3\S3Client([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'key' => 'AKXXXXXXXXXXXXXXXXXXQ',
'secret' => 'twHHXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXh'
],
'debug' => false
]);

$bucket = 'test-bucket';
$key = 'test.mp4';
$result = $s3->putObject([
'Bucket' => $bucket,
'Key' => $key,
'SourceFile' => '/home/titus/test/aws-php-sample/test.mp4',
]);

screen-shot-2016-11-10-at-10-34-39-am

Run sample from the url or command:

php test.php

If it is not working, change debug value as true. Then you can see what the problem is.

Simple is beautiful as always.

Facebook Comments

Make WordPress post url search engine friendly

When WordPress installed, the url is not customized for Search engines.

Here’s how to make each post url friendly.

  1. Go to Settings > Permalinks.
  2. Select post name

wordpress-post-url-friendly

Now url changed like this.

screen-shot-2016-10-28-at-11-08-54-am

How beautiful it is.

Facebook Comments

How to install WordPress using Parallels Panel

Once you ordered web hosting, you can create website using Word Press. It’s pretty easy, only need few clicks.

First go to Applications menu in Parallels Panel and click Word Press install button.

setup-wordpress-from-parallels-panel

Then you can login as Administrator. Make sure change password in the profile page for login next time.

setup-wordpress-from-parallels-panel2

Here we go!

setup-wordpress-from-parallels-panel3

Facebook Comments