New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix php detection when called by composer 1.3+ #299

Closed
Seldaek opened this Issue Dec 11, 2016 · 5 comments

Comments

Projects
None yet
6 participants
@Seldaek
Contributor

Seldaek commented Dec 11, 2016

As Composer 1.3RC is out, this should be done to avoid any problems with our new xdebug-circumvention code..

See composer/composer#5783 (comment) and especially the last comment for details. If you want maximum compatibility, you can use Composer\Composer::VERSION to do it selectively for new versions, but this is set to a git hash for snapshot builds so maybe rather check if VERSION is not a hash and is below 1.3 then do the old behavior, otherwise do new behavior (as snapshots are more likely to be recent I guess..)

@gondo

This comment has been minimized.

Show comment
Hide comment
@gondo

gondo Dec 30, 2016

this issue was fixed for a while but latest self-update caused composer to update to version 1.3.0 2016-12-24 00:47:03 and the issue re-appeared

gondo commented Dec 30, 2016

this issue was fixed for a while but latest self-update caused composer to update to version 1.3.0 2016-12-24 00:47:03 and the issue re-appeared

@Pharkie

This comment has been minimized.

Show comment
Hide comment
@Pharkie

Pharkie Jan 2, 2017

Same as @red-smeg:

composer update

using composer 1.3.0 (Symfony 2.8.15, PHP 5.6 on Ubuntu 16.04.01LTS) gives

Cannot load Zend OPcache - it was already loaded
PHP Warning: Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning: Module 'PDO' already loaded in Unknown on line 0

...and so on for every PHP module, and this appears multiple times each time PHP is invoked on the CLI by the composer update (3 times I think). Looks like an issue with composer and using multiple (copies of) the PHP ini file?

This started happening I think when I changed my composer.json to use

"sensio/distribution-bundle": "~5.0"

Hope this can be fixed.

Pharkie commented Jan 2, 2017

Same as @red-smeg:

composer update

using composer 1.3.0 (Symfony 2.8.15, PHP 5.6 on Ubuntu 16.04.01LTS) gives

Cannot load Zend OPcache - it was already loaded
PHP Warning: Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning: Module 'PDO' already loaded in Unknown on line 0

...and so on for every PHP module, and this appears multiple times each time PHP is invoked on the CLI by the composer update (3 times I think). Looks like an issue with composer and using multiple (copies of) the PHP ini file?

This started happening I think when I changed my composer.json to use

"sensio/distribution-bundle": "~5.0"

Hope this can be fixed.

@kachkaev

This comment has been minimized.

Show comment
Hide comment
@kachkaev

kachkaev Jan 4, 2017

I just ran composer update sensio/distribution-bundle (v5.0.15 => v5.0.17) and the warnings disappeared! Thanks a lot for the fix @fabpot!

kachkaev commented Jan 4, 2017

I just ran composer update sensio/distribution-bundle (v5.0.15 => v5.0.17) and the warnings disappeared! Thanks a lot for the fix @fabpot!

@Pharkie

This comment has been minimized.

Show comment
Hide comment
@Pharkie

Pharkie Jan 5, 2017

Confirmed fixed this end too: 'composer update' now runs without any PHP module warnings. Huge thanks.

Pharkie commented Jan 5, 2017

Confirmed fixed this end too: 'composer update' now runs without any PHP module warnings. Huge thanks.

javiereguiluz added a commit to symfony/demo that referenced this issue Jan 10, 2017

bug #426 Updated sensio/distribution-bundle dependency to fix loading…
… PHP extensions twice (bocharsky-bw)

This PR was merged into the master branch.

Discussion
----------

Updated sensio/distribution-bundle dependency to fix loading PHP extensions twice

Related to the sensiolabs/SensioDistributionBundle#299

Current version of `sensio/distribution-bundle` with Composer 1.3 throws warnings on composer install/update:
```
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Cannot load Zend OPcache - it was already loaded
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning:  Module 'OAuth' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_pgsql' already loaded in Unknown on line 0
PHP Warning:  Module 'yaml' already loaded in Unknown on line 0

Warning: Module 'imagick' already loaded in Unknown on line 0

Warning: Module 'intl' already loaded in Unknown on line 0

Warning: Module 'mcrypt' already loaded in Unknown on line 0

Warning: Module 'OAuth' already loaded in Unknown on line 0

Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0

Warning: Module 'yaml' already loaded in Unknown on line 0
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
Cannot load Zend OPcache - it was already loaded
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning:  Module 'OAuth' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_pgsql' already loaded in Unknown on line 0
PHP Warning:  Module 'yaml' already loaded in Unknown on line 0

Warning: Module 'imagick' already loaded in Unknown on line 0

Warning: Module 'intl' already loaded in Unknown on line 0

Warning: Module 'mcrypt' already loaded in Unknown on line 0

Warning: Module 'OAuth' already loaded in Unknown on line 0

Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0

Warning: Module 'yaml' already loaded in Unknown on line 0

 // Clearing the cache for the dev environment with debug
 // true

 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
Cannot load Zend OPcache - it was already loaded
PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning:  Module 'OAuth' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_pgsql' already loaded in Unknown on line 0
PHP Warning:  Module 'yaml' already loaded in Unknown on line 0

Warning: Module 'imagick' already loaded in Unknown on line 0

Warning: Module 'intl' already loaded in Unknown on line 0

Warning: Module 'mcrypt' already loaded in Unknown on line 0

Warning: Module 'OAuth' already loaded in Unknown on line 0

Warning: Module 'pdo_pgsql' already loaded in Unknown on line 0

Warning: Module 'yaml' already loaded in Unknown on line 0

 Trying to install assets as relative symbolic links.

 --- ------------------------------ ------------------
      Bundle                         Method / Error
 --- ------------------------------ ------------------
  ✔   WhiteOctoberPagerfantaBundle   relative symlink
 --- ------------------------------ ------------------

 [OK] All assets were successfully installed.

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
```

Commits
-------

c18a2f5 Fix loading PHP extensions twice by sensio/distribution-bundle
@teameh

This comment has been minimized.

Show comment
Hide comment
@teameh

teameh Feb 2, 2017

Thanks for backporting this to v4 as well @fabpot!

teameh commented Feb 2, 2017

Thanks for backporting this to v4 as well @fabpot!

imphil added a commit to librecores/librecores-web that referenced this issue Feb 13, 2017

Enable XDebug in Vagrant environment
Unfortunately, sensio/distribution-bundle has a couple of bugs related
to xdebug.
We need at least a current version 4 or 5.0.17 for
sensiolabs/SensioDistributionBundle#299 to be
fixed. And we cannot use versions >= 5.0.15, otherwise we hit
sensiolabs/SensioDistributionBundle#302. So
staying with version 4 for now until this is sorted out upstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment