Is Vercel's .env CLI compatible with vercel-php?
varunsingh87 opened this issue · comments
Varun Singh commented
Question
Are the vercel env
commands usable for the vercel-php runtime? I want to store some secrets that are encrypted through Vercel. They are stored in my gitignored .env
file. Can I access this in PHP?
Milan Felix Šulc commented
Hi. Yup, Environment Variables are supported. :-)
- It works seamless on Vercel platform, after deployment.
- Locally, it depends as you start your local development server.
SOME_ENV=foo php -S localhost:8000 api/index.php
Varun Singh commented
Thank you!
How do we access these variables in PHP? The docs only talk about JavaScript
Varun Singh commented
I am going to try using PHP's $_ENV
Milan Felix Šulc commented
Yes, use $_ENV
or getenv()
.
I will put it on vercel-php doc.
Varun Singh commented
Thank you very much!