PHP versions on macosx

CLI

Install the version you want from here https://php-osx.liip.ch.

Add the new php binary to the end of your path https://php-osx.liip.ch/#faq.

Reload your .bash_profile

To switch back to default just remove php binary from your path

To switch between newly installed versions go to

/usr/local/php5/entropy-php.conf

APACHE

See the Apache configuration here https://coolestguidesontheplanet.com/upgrade-php-on-osx/

Advertisements

Elastic beanstalk Laravel

Amazon account

Create a new IAM user access_id and secret_key.

Elastic beanstalk CLI

Please install:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html?icmpid=docs_elasticbeanstalk_console

App repo

Clone your repo into a new directory and go to it.

Fire up a new EB instance

$ eb init
If you have multiple profiles in your ~/.aws/config
$ eb init --profile name

Deploy to staging

For the initial deployment.
This is going to fail because we haven’t uploaded our configs.
We want classic deployment.
$ eb create environment_name --database

Run on deployment

Add these to your project before you deploy:
https://github.com/jianliyow/elasticbeanstalk-laravelconfigs

$ eb deploy

App config

Set the APP_URL in configuration > software configuration.
e.g. http://localhost or https://staging.example.com

Database config

We don’t need to do anything here because database.pro reads the server variables.

S3 bucket config

https://jianliyow.wordpress.com/2017/08/23/aws-s3-bucket-policy-and-iam-policy/

Production environment

Clone the staging environment in AWS console. Initially it will fail. 

Database config

  • Allow office IP 
  • Copy the data over to the new DB

Route 53

https://console.aws.amazon.com/route53/home?region=ap-southeast-1
Create a hosted zone.
Point domain name to AWS name servers.
Create aliases.

Create SSL cert

https://ap-southeast-1.console.aws.amazon.com/acm/home?region=ap-southeast-1#/

Redirect to https

Include the redirect code in .ebextensions/01setup.config