

Instead, you should store such information in an application’s environment and read it from there at runtime.Īny config var you set on your Heroku application will be available at runtime using getenv() or in $_ENV/ $_SERVER.

Hard-coding database connection information, security credentials, or other runtime settings is not a good idea.

Now you can commit everything: $ git add composer.*. gitignore you only want your composer.json and composer.lock, but not the vendor/ directory, under version control: $ echo "vendor" >. If you haven’t already done so, now is a good time to add the vendor/ directory to your. The composer require command is the easiest way (alternatively, you can add the aws/aws-sdk-php package to composer.json by hand): $ composer require aws/aws-sdk-php:~3.0 The easiest way to install the AWS SDK for PHP is using Composer. If you haven’t created a Heroku application and Git repository yet, do so first: $ mkdir heroku-s3-example Read our Using AWS S3 to Store Static Assets and File Uploads guide for more information it contains detailed background knowledge, step-by-step instructions for getting started with S3, and useful tips and tricks.
