Skip to content

Instantly share code, notes, and snippets.

@mikehains
mikehains / gist:08b61c621320f78a5f14f89ad3a5739f
Last active May 20, 2019 20:14
AWS EC2 (beanstalk) PHP 7.2 ... Sodium ... Solution

AWS have published that their AMI with PHP 7.2 has sodium (cryptography).

Plainly (as at writing) it does not. There is no package available. There is no solution.

Have attempted installing etc, but it is a long way around and messy.

Instead, there is an excellent PHP 7.2 Polyfill, from the orignal authors - right here: https://github.com/paragonie/sodium_compat

Here's how to install it:

<?php
/* ----------------------------------------------------------------------------
Create a file in root directory, called: composer.json
with the following content:
{
"require": {
"aws/aws-sdk-php": "*"
}
}
@mikehains
mikehains / globals_module
Created May 4, 2018 23:17
Javascript module storing globals in an easy jQuery like way
<script type="text/javascript">
(function(){
// These are <<functions>> exposed on the object as properties.
var _publics = {
globals : _globals
};
/* ----------------------------------------------------------------
@mikehains
mikehains / https-on-localhost.md
Last active April 28, 2018 22:09 — forked from adnan360/https-on-localhost.md
Use HTTPS on Localhost (XAMPP, Windows)

Sometimes some websites require https to work. This can be useful in those cases.

This has been tested with XAMPP (PHP 7.0.8) on Windows 7. Please see the Reference links at the end if in confusion about some step.

STEP 1: Editing Configs

Open:

C:\xampp\php\php.ini