I have these lines in PHP:
public function run(){
$command = 'php -S localhost:1337';
exec($command);
}
I created a simple commands in php, something like this:
php file run
When the user enters this command, PHP goes to the method run() but the output message is empty and the server already are running.
But when I run the command php -S localhost:8000
directly in cli it shows this message:
C:\xampp\htdocs\hola>php -S localhost:8000
PHP 5.6.31 Development Server started at Mon Jan 15 15:52:34 2018
Listening on http://localhost:8000
Why the output message of the command line is not showing only when the command is executed from a file?.