How to Set a Web Env Variable From the Command Line on Linux/Unix

Jordi Bassagañas
Nov 3 · 2 min read

Are you a full-stack PHP developer? Chances are that you might want to easily override an environment variable through the command-line interface.

Let’s say you are writing a bash script to automate a certain process: your Docker containers must be rebuilt, and the app’s DB_HOST and REDIS_HOST variables must be updated accordingly.

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

Jordi Bassagañas

Written by

Hi there! How are you today? I blog about technology, the Internet, SEO, programming tips, PHP and many other things.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade