How to recover terminal data with php?

3

Example, I have this following command in a php file:

<?php

$imprimir = shell_exec("cd /home/afonso/Documentos/teste; git add arquivo.txt; git commit -m 'testando'; git push -u origin master");

So far everything works fine, except that he asks me to put the Bitbucket password in the terminal and I want to "recover" that part, that is, instead of typing the password in the terminal I want it to enter the password in a screen on the php page.

    
asked by anonymous 29.01.2016 / 13:32

1 answer

4

Try this:

echo shell_exec("cd /home/afonso/Documentos/teste; git add arquivo.txt; git commit -m 'testando'; git push -u origin master" 2>&1");

this 2 > & 1 will capture everything your terminal would display

    
29.01.2016 / 14:10