2016-10-24 2 views
1

컨트롤러에서 php /bin/composer.phar dump-autoload을 실행하고 싶습니다.
내가 shell_exec("dir");을 실행할 때 공용 폴더에이고 나는이 명령을 실행하면 shell_exec("cd .. ; dir ")을 실행할 때 나는 아직 공용 폴더에이기 때문에 shell_exec("cd.. & php /bin/composer.phar dump-autoload"); 아무것도 을 발생하지 때문에 shell_exec("php /bin/composer.phar dump-autoload");
용량이 작동하지 실행합니다. 내 호스트 in centos 6composer dump-autoload가 컨트롤러 Laravel 5에서 작동하지 않습니다.

+2

[this] (http://stackoverflow.com/questions/23704140/dump-autoload-command-from-php) 대답을 시도해 볼 수 있습니다. 몇 가지 해결 방법을 얻을 수 있기를 바랍니다. –

답변

3

\Symfony\Components\Process\Process을 사용해 볼 수 있습니다. 이 도움이

(new \Symfony\Components\Process\Process('composer dump-autoload', base_path()))->setTimeout(10)->mustRun(); 

희망 :

그래서 당신이 뭔가를 할 것이다!

관련 문제