1

I'm trying to use my docker php as an interpreter in my terminal. What I need:

  • I don't keep my dev envs on my host os. That's important to keep it isolated
  • It should be available as $php or $/usr/bin/env php
  • I'd like to be able to run something like phpcs in my vim. It requires that thingy above.

I've tried this:

alias php='docker-compose exec php php'

But it's not available through /usr/bin/env

1 Answer 1

1

/usr/bin/env tries to locate the executable via the $PATH variable, see https://unix.stackexchange.com/a/12749

So if you put your command in to a script called PHP and add it to your $PATH before other PHP executables, it might work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.