{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/18503","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/18503/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18503/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/18503/events","html_url":"https://github.com/symfony/symfony/issues/18503","id":147392291,"number":18503,"title":"Process fails inside apache mod_php","user":{"login":"Seldaek","id":183678,"avatar_url":"https://avatars.githubusercontent.com/u/183678?v=3","gravatar_id":"","url":"https://api.github.com/users/Seldaek","html_url":"https://github.com/Seldaek","followers_url":"https://api.github.com/users/Seldaek/followers","following_url":"https://api.github.com/users/Seldaek/following{/other_user}","gists_url":"https://api.github.com/users/Seldaek/gists{/gist_id}","starred_url":"https://api.github.com/users/Seldaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seldaek/subscriptions","organizations_url":"https://api.github.com/users/Seldaek/orgs","repos_url":"https://api.github.com/users/Seldaek/repos","events_url":"https://api.github.com/users/Seldaek/events{/privacy}","received_events_url":"https://api.github.com/users/Seldaek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-11T11:03:42Z","updated_at":"2016-04-11T11:21:46Z","closed_at":null,"body":"## Environment\r\n\r\nsymfony/symfony               v2.8.4\r\n\r\nPHP `5.5.9-1ubuntu4.14` / `API220121212,NTS`\r\n\r\nApache modules: `core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_bw mod_cgi mod_deflate mod_dir mod_env mod_expires mod_filter mod_headers mod_mime prefork mod_negotiation mod_php5 mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status`\r\n\r\nPHP Extensions: `bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, intl, json, libxml, mbstring, mcrypt, memcachememcached, mhash, mysql, mysqli, newrelic, openssl, pcntl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standardsysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib`\r\n\r\n## Problem\r\n\r\n```php\r\n<?php\r\ninclude __DIR__.'/../vendor/autoload.php';\r\n$proc = new \\Symfony\\Component\\Process\\Process('echo TEST');\r\nvar_dump(\r\n   $proc->start(),\r\n   $proc->wait(),\r\n   $proc->getExitCode(),\r\n   $proc->getOutput(),\r\n   $proc->getErrorOutput()\r\n);\r\n/* outputs:\r\nNULL NULL NULL string(0) \"\" string(0) \"\"\r\n*/\r\n\r\n$proc2 = proc_open('echo TEST2', [1=>['pipe', 'w']], $pipes);\r\nvar_dump(is_resource($proc2));\r\nif (is_resource($proc2)) {\r\n    var_dump(stream_get_contents($pipes[1]));\r\n    fclose($pipes[1]);\r\n    var_dump(proc_close($proc2));\r\n}\r\n/* outputs\r\nbool(true) string(6) \"TEST2 \" NULL\r\n*/\r\n```\r\n\r\nAs you can see, proc_open *kinda* works at least the output works, but the exit code is null, which is already pretty bad. But then with the Process component I don't even get the output to work.\r\n\r\nNote that if I run the script from CLI, it works fine, I get 0 exit codes and output for both examples. Running via Apache mod_php fails."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/208293296","html_url":"https://github.com/symfony/symfony/issues/18503#issuecomment-208293296","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18503","id":208293296,"user":{"login":"Seldaek","id":183678,"avatar_url":"https://avatars.githubusercontent.com/u/183678?v=3","gravatar_id":"","url":"https://api.github.com/users/Seldaek","html_url":"https://github.com/Seldaek","followers_url":"https://api.github.com/users/Seldaek/followers","following_url":"https://api.github.com/users/Seldaek/following{/other_user}","gists_url":"https://api.github.com/users/Seldaek/gists{/gist_id}","starred_url":"https://api.github.com/users/Seldaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seldaek/subscriptions","organizations_url":"https://api.github.com/users/Seldaek/orgs","repos_url":"https://api.github.com/users/Seldaek/repos","events_url":"https://api.github.com/users/Seldaek/events{/privacy}","received_events_url":"https://api.github.com/users/Seldaek/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T11:21:46Z","updated_at":"2016-04-11T11:21:46Z","body":"On 2.8.0 the first outputs `NULL NULL NULL NULL NULL` which isn't much better ;)"}}