2017-01-10 1 views
1

내가 스크립트 PHP 추적이 : 내가 명령 창으로 테스트 할 때PHP : shell_exec 자식 풀 패스 암호는

shell_exec('D: && cd D:\Xampp\htdocs\demo_gitlab && git pull'); 

(PHP와 업데이트 gitlab을) 다음 결과 : 그래서

C:\Users\nknha>D: && cd D:\Xampp\htdocs\demo_gitlab && git pull 
Enter passphrase for key '/c/Users/nknha/.ssh/hsdichvu': 
remote: Counting objects: 3, done. 
remote: Compressing objects: 100% (3/3), done. 
remote: Total 3 (delta 2), reused 1 (delta 0) 
Unpacking objects: 100% (3/3), done. 
From gitlab.com:huesoft/diet-tru-sau 
    7e940be..22886d0 master  -> origin/master Updating 7e940be..22886d0 
Fast-forward 
    README.md | 4 +++- 
    1 file changed, 3 insertions(+), 1 deletion(-) 

명령을 실행할 때 어떻게 암호문을 입력 할 수 있습니까? shell_exec

답변

0

외부 프로그램의 일부이므로 그대로 사용할 수 없습니다.
인수로만 전달할 수 있습니다. 별도의 쉘 스크립트를 만들고 shell_exec()으로 실행하는 것이 좋습니다.