Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
システムでWAMPサーバーを使用してphpスクリプトを実行しています。
test.phpメインスクリプトからスクリプトを実行したいmain.php。
test.php
main.php
そのために私はexecこのような関数を使用していますexec('php test.php');。私は1つのステートメントtest.phpを与えました。echo
exec
exec('php test.php');
echo
しかしmain.php、ブラウザからスクリプトを実行すると、スクリプトの出力が表示されませんtest.php。
私は何を間違っているのですか?提案してください。
あなたはの適切な道を与える必要がありますphp.exe
php.exe
exec("c:\wamp\<where ever you exe is>/php.exe test.php");
だからそれは適切な道でなければなりません
このコマンドを使用する
echo exec('php test.php', $output); //this will print your echo statement. print_r($output);