6
6
655362015-11-26 23:36:27
PHP
65536, 2015-11-26 23:36:27

Why doesn't the exec('php test.php > test.txt'); construct work?

The file is created, but the result of any command is not written to it. For example, the result of exec('php -i > test.txt'); is again an empty file.
PHP does not output exactly the result, exec('echo "test" > test.txt'); for example writes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-11-26
@65536

Trouble with the path? try specifying the full path to the interpreter. By the way - maybe the rights are not enough.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question