PHP code example of sam002 / yii2-acme

1. Go to this page and download the library: Download sam002/yii2-acme library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sam002 / yii2-acme example snippets


...
'module' => [
    //Catch all requests on .well-known
    '.well-known' => [
        'class' => 'sam002\acme\Acme',
        //optional
        'location' => realpath('../runtime/acme'),
        'providerUrl' => Acme::PROVIDERS['letsencrypt:production']
        'keyLength' => 2048,
        'keyStorage' => 'sam002\acme\storage\file\KeyStorageFile',
        'certificateStorage' => 'sam002\acme\storage\file\CertificateStorageFile'
        'challengeStorage' => 'sam002\acme\storage\file\ChallengeStorageFile'
    ],
    ...
]

...
'controllerMap' => [
    'acme' => [
        'class' => 'sam002\acme\console\AcmeController'
    ],
    ...
]