Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Process::setTty does not seems to work #9861

Copy link
Copy link
Closed
@mathroc

Description

@mathroc
Issue body actions

I am trying to run the PHP buitin web server with Symfony\Component\Process\Process and get its output but I'm having issue.

I think it's because php -S does not print output in non tty mode (eg: php -S 127.0.0.1:8080 | cat). So I tried to turn on tty on this process but this does not work either. after looking at the code, it seems that the private member tty is not used anymore. it was added here : 2d30fb3#diff-f9f2411040cda7b73402481facf3e4dd but I can't find when it disappeared.

here is a small php file to test it :

<?php

require_once 'vendor/autoload.php';

use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\PhpExecutableFinder;

$finder = new PhpExecutableFinder;
$php = $finder->find();

$builder = new ProcessBuilder([$php, '-S', '127.0.0.1:48880']);
$builder->inheritEnvironmentVariables(true);

$process = $builder->getProcess();

$process->setTty(true);

$process->start();

sleep(2);

$output = $process->getOutput();

assert($output !== null);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.