GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • About
  • Changelog
  • Newsletter
  • Trust GDPR
  • Pricing
  • Agents
  • Login
  • Contact
  • Docs
  • Install
  • Quickstart
  • Advanced
  • Node.js

This view

  • Original page
  • New address

GeezerVison is showing dotenvx.com — Encrypt a .env file in PHP

PHP

Encrypt a .env file in PHP with dotenvx, commit it safely, and inject its secrets at runtime.

Install

Get the Dotenvx CLI.

$ curl -sfS https://dotenvx.sh | sh

Encrypt

Encrypt your .env file.

$ dotenvx encrypt

Inject

Then inject your encrypted secrets at runtime with dotenvx run.

<?php

echo "Hello {$_SERVER['HELLO']}\n";
$ dotenvx run -- php index.php
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.