This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier f11d7a0a0c merged branch Seldaek/sigchild-workaround (PR #5353)
Commits
-------

7b63428 [Process] Add workaround for PHP's internal sigchild failing to return proper exit codes

Discussion
----------

[Process] Add workaround for PHP's internal sigchild failing to return proper exit codes

PHP compiled with --enable-sigchild basically fails to return exit codes, and randomly returns -1 instead most of the time (see https://bugs.php.net/bug.php?id=29123).

This works around it by having the exit code going through another pipe. It's enabled by default for linux because the new pipe trick won't work on windows I think, but that's unlikely to be an issue because most people don't compile their own php there.

I could have it enabled only when sigchild is enabled using the code below, but obviously that adds some overhead, so I'm not sure what's worst.

```php
ob_start();
phpinfo(INFO_GENERAL);
$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild');
```

That said, this renders composer unusable (because we do check exit codes) for people having sigchild enabled, and it's not so easy to workaround outside of the Process class itself, so I hope this is an acceptable fix.

---------------------------------------------------------------------------

by schmittjoh at 2012-08-26T13:41:18Z

How about prepending commands with ``exec`` to avoid spawning child processes altogether?

see #5030

---------------------------------------------------------------------------

by Seldaek at 2012-08-26T13:51:40Z

@schmittjoh I'm not sure how that's related to this issue? The problem here is that $exitcode is -1 when it should be 0, I don't see how the additional level of exec would help but maybe I'm missing your point.

---------------------------------------------------------------------------

by schmittjoh at 2012-08-26T13:59:15Z

I haven't looked in detail at this, but exec removes the child wrapper that PHP adds normally.

---------------------------------------------------------------------------

by fabpot at 2012-08-26T16:10:24Z

What about doing the fix in 2.0?

---------------------------------------------------------------------------

by stof at 2012-08-26T16:13:04Z

Can it be applied to 2.0 without too much work ? The Process component has been refactored for 2.1

---------------------------------------------------------------------------

by Seldaek at 2012-08-26T16:16:06Z

Just tried to rebase and it's not so trivial.. I can try to rebuild the
patch from scratch for 2.0 if it's important.

---------------------------------------------------------------------------

by fabpot at 2012-08-26T16:24:38Z

ok, let's only do the fix for master for now.

---------------------------------------------------------------------------

by Seldaek at 2012-08-26T20:49:39Z

@fabpot ok so the question remains whether there should be a ctor check for the configure flag to enable this or if we just always do it and hope it doesn't cause issues.
2012-08-28 07:36:52 +02:00
src/Symfony [Process] Add workaround for PHP's internal sigchild failing to return proper exit codes 2012-08-26 15:13:51 +02:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore ignore composer.phar 2012-04-20 14:10:06 +01:00
.travis.yml [Locale] don't create a "current" directory anymore, uses only the ICU version as the name of the data directory 2012-08-07 12:17:02 -03:00
autoload.php.dist removed unneeded code 2012-06-30 16:47:41 +02:00
CHANGELOG-2.0.md merged 2.0 2012-08-03 11:11:11 +02:00
composer.json Update monolog compatibility 2012-08-19 09:57:44 +02:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.14 2012-05-17 18:30:22 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist Set init.default_locale to 'en' in phpunit.xml.dist 2012-05-11 09:33:42 +02:00
README.md added some warnings about known PHP bugs 2012-07-15 12:19:52 +02:00
UPGRADE-2.1.md fixed typos in the UPGRADE file 2012-08-16 20:10:26 +02:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.