K
K
Katya2017-01-17 10:46:22
PHP
Katya, 2017-01-17 10:46:22

Why is the empty result of executing a command from the command line displayed?

Hello! Maybe you can help me? I would appreciate it.
I created a result.php file with the following content:
<?php phpinfo(); ?>. In the browser on the local host, everything is fine.
I execute in the command line c:\Server\data\htdocs\result.php > c:\Server\data\htdocs\result.txt
As a result, result.txt is formed in the specified folder, but it is completely empty. And he needs to give out information. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Semenko, 2017-01-17
@kate0611

You need to run through PHP:

php -f c:\Server\data\htdocs\result.php > c:\Server\data\htdocs\result.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question