Page tree
Skip to end of metadata
Go to start of metadata

This tutorial requires advanced knowledge. We recommend you get professionals to do this if you are not at an advanced level.

The video app provided with phpFox requires a Zencoder and an Amazon S3 account if you want your users to upload videos.

Tip

The purpose of this document is to provide detailed steps to set up the Video app with Zencoder and Amazon S3  for using the video upload feature of phpFox. If you only want your users to share videos from video-sharing sites such as YouTube, Vimeo, etc, you don't need to do the following steps. All you need to do is go to the app in your AdminCP and click Enable the Videos app.

Set up Zencoder

  1. Sign up for Zencoder
  2. Login at Zencoder.
  3. Visit the API section.
  4. On this page look for your Full Access API Keys. It should be a 32 character alphanumeric key.
  5. Copy the key and log into your phpFox AdminCP and navigate to Apps > Videos
  6. Enter your key for the setting Zencoder API Key
  7. Configure credentials of AWS S3 Service for Zencoder

Set up Amazon S3 & Access Keys

If you don't have one already, Sign up for Amazon account and then Login.

Once you have logged in, visit the Security Credentials section.


Amazon Access Keys

If you don't have Amazon access keys already set up, you need to click Access Keys (Access Key ID and Secret Access Key), this will open up

Once you click the Create New Access Key button, you will get a popup where you can download your access keys. You can also click on Show Access Key. Keep this information in a safe place.

Now that you have your access keys, log into your AdminCP and navigate to Apps > Videos and fill out the settings Amazon S3 Access Key and Amazon S3 Secret with the new keys you created.

Amazon S3 Bucket

Next we need a bucket to store any videos uploaded to your site. From your Amazon Console, click on Services and look for and click on S3.

If this is your first time creating a bucket, you will see a welcome back with a button to Create Bucket. Click on this button to get things started.

Once you have clicked this button you will get a popup where you can enter a Bucket Name. You need to enter something unique. 


Bucket Policy

With your bucket created you know need to give Zencoder access to your bucket so they can upload files that have been encoded. To do this click on your new bucket and then click Properties. Then click on Permissions

We are looking for the Edit bucket policy link. Click on that to get a popup where you can enter your policy. Here is a sample policy 

{  "Version": "2008-10-17",
  "Id": "ZencoderBucketPolicy",
  "Statement": [
    {
      "Sid": "Stmt1295042087538",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::395540211253:root"
      },
      "Action": [
        "s3:GetObjectAcl",
        "s3:GetObject",
        "s3:PutObjectAcl",
        "s3:PutObject",
        "s3:ListMultipartUploadParts"
      ],
      "Resource": "arn:aws:s3:::MY-BUCKET/*"
    },
    {
      "Sid": "Stmt1295042087538",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::395540211253:root"
      },
      "Action": [
        "s3:ListBucketMultipartUploads",
        "s3:GetBucketLocation"
      ],
      "Resource": "arn:aws:s3:::MY-BUCKET"
    }
  ]
}

Before Pasting: You need to change the words MY-BUCKET with the name of the bucket you just created. Once you have done that paste it into the bucket policy editor and hit Save.

Updating App Settings

Now that we have all the details we need to enable our app. Navigate to Apps > Videos and for the setting Amazon S3 Bucket enter the bucket name. For the setting Provide the S3, CloudFront or Custom URL you can enter the default S3 URL with the bucket name after it. So in this example, we created a bucket called my-phpfox-test-bucket, location: US Standard. So for the URL setting, we enter: 

https://s3.amazonaws.com/my-phpfox-test-bucket/

If you select other location, please do more step to know your bucket url:

Upload a file to that bucket, click to view file detail, you will see your bucket URL.

Now that we have all the settings in place for the setting Video App Enabled you can click Yes.