내 MacOSX에서 쉘 스크립트를 실행하려고하는데 작동하지 않습니다. 내 report.sh 파일은/usr/local/bin에 저장된 다른 .sh 파일 (Sweave.sh)을 호출합니다.PHP shell_exec not working
<?php
shell_exec("./report.sh");
echo "Hello 123";
?>
내 브라우저에는 'Hello 123'이 인쇄되지만 report.sh은 해당 작업을 수행하지 않습니다. 왜 그런가? 여기에 report.sh가 있습니다 :
# !/bin/bash
Sweave.sh -ld test_sweave.Rnw
전화 ./report.sh를 터미널에서 호출하면 문제가 없습니다 ... 도움을 주셔서 감사합니다!
편집 : 내가 터미널에서 ./report.php 호출하면, 그것은 말한다 :
가) 시작 :
./report.php: line 2: ?php: No such file or directory
./report.php: line 4: syntax error near unexpected token `"./report.sh"'
./report.php: line 4: `shell_exec("./report.sh");'
사용 절대 경로는 다음 시도합니다. –
나는 이미했으나 아무 일도 일어나지 않고 안전 모드가 꺼져 있습니다. – Fernando
당신은 아파치를 사용하고 있습니까? 그렇다면 아파치 사용자에게 파일을 실행할 수있는 충분한 권한이 있습니까? –