Skip to content

envkey-php: ENVKEY invalid. Couldn't load vars. #92

Answered by nikalas
nikalas asked this question in Q&A
Discussion options

You must be logged in to vote

Seems the problem is running PHP under Apaches Virtual Host (With FastCGI?) which runs sandboxed. As you say the env's are not exposed to the php service because of this. Which I guess is actually in the ENVKEY documentation. Also nothing to do with WordPress per se.

So the solution here seems to be to, if I understand it correctly:

  • Generate a local key for each local app.
  • Put it in MAMP under "Additional parameters for directive" for each site as SetEnv ENVKEY <local-key-here>
  • Insert your snippet before require_once 'vendor/autoload.php' (I still don't see why this is needed as I can getenv('ENVKEY') and get the local key earlier, but it does not work without it.)

Thank you for you help!

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@nikalas
Comment options

Comment options

You must be logged in to vote
5 replies
@nikalas
Comment options

@danenania
Comment options

@danenania
Comment options

@nikalas
Comment options

@nikalas
Comment options

Comment options

You must be logged in to vote
1 reply
@danenania
Comment options

Answer selected by danenania
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants