Comprehensive examples for encrypting secrets with Dotenvx in PHP.
- PHP 8.1+
- Optional: a Dotenvx account
dotenvx encrypt
dotenvx run -- php index.php<?php
echo 'HELLO: ' . (getenv('HELLO') ?: '') . PHP_EOL;php-dotenvx-examples/
├── index.php
└── README.md