2012-10-31 4 views
0

에서 PHP 파일을 실행할 수 없습니다 :명령을 사용하여 콘솔

$output = shell_exec("/usr/bin/php /path/to/my/file.php"); 
echo $output; 

이 결과를 얻기 :

string(1208) "Content-type: text/html string(1165) "Content-type: text/html string(1122) "Content-type: text/html string(1079) "Content-type: text/html string(1036) "Content-type: text/html string(994) "Content-type: text/html string(952) "Content-type: text/html string(910) "Content-type: text/html string(868) "Content-type: text/html string(826) "Content-type: text/html string(784) "Content-type: text/html string(742) "Content-type: text/html string(700) "Content-type: text/html string(658) "Content-type: text/html string(616) "Content-type: text/html string(574) "Content-type: text/html string(532) "Content-type: text/html string(490) "Content-type: text/html string(448) "Content-type: text/html string(406) "Content-type: text/html string(364) "Content-type: text/html string(322) "Content-type: text/html string(280) "Content-type: text/html 
Warning: shell_exec() [function.shell-exec]: Unable to execute '/usr/bin/php /home/zumblemo/public_html/ad/../test.php' in /home/zumblemo/public_html/ad/test.php on line 5 
bool(false) " " " " " " " " " " " " " " 

그것은해야 바로 출력 단어가 지금은 "테스트".
나는 그것을 얻지 않는다. 이렇게 파이썬 파일을 실행하면 작동합니다.
호스팅 지원은 PHP 파일에서도 작동해야한다고 말합니다. 큰 : - (그것은 그냥해야 같은 NULL 결과를 제공 그들이 잘못된 경우)

PS

경로는 100 % 정확! php-cli가 작동했습니다. 감사합니다.

+1

아마도 사용자 권한? –

+1

'/home/zumblemo/public_html/ad/test.php on line 5 '에 대한 코드를 보여줄 수 있습니까? *** snip *** (대답으로 이동) – jimp

+0

그냥 file.php 또는 file_get_contents를 포함시키지 마십시오. – case1352

답변

0

재귀 한계에 도달 할 때까지 스크립트가 반복적으로 자신을 호출하는 것처럼 보입니다. 또한 php가 php-cgi에 대한 심볼릭 링크 일 수도 있습니다. 대신 php-cli를 호출 해보십시오.

관련 문제