コマンドの使用:
$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) " " " " " " " " " " " " " "
今のところ、「Test」という単語を出力するだけです。
理解できません。このような Python ファイルを起動すると、動作します。
ホスティング サポートによると、PHP ファイルでも同様に機能するはずです。
パスは 100% 正しい (パスが正しくない場合 - 当然のように NULL の結果が返される)
PS: すごい!php-cli が機能しました。ありがとう!