- create a file on /usr/local/bin with name 'php';
nano /usr/local/bin/php
- paste de following code:
#!/bin/bash
docker exec -i --user=1000:1000 YOUR-CONTAINER-NAME php "$@"
*** Change "YOUR-CONTAINER-NAME".
***
- Give permission to execute:
chmod +x /usr/local/bin/php
- Now, you can do:
php -v
on your local machine.
- And your php path is;
/usr/local/bin/php
permission denied: php
just change the owner of file;
sudo chown $USER:$USER /usr/local/bin/php
Error: No such container: docker_apache
check container name on php file.