Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Installing with php7.2 fails at composer install, referencing 7.3 extensions #1903

Closed
bits-of-static opened this issue Feb 24, 2019 · 12 comments

Comments

@bits-of-static
Copy link

bits-of-static commented Feb 24, 2019

Issue Type

  • Bug Report / Support Request

Your Environment

Vagrant 2.0.2
bash: vboxmanage: command not found
VirtualBox
bash: ansible: command not found

Your OS

  • Windows 10

Full console output

TASK [geerlingguy.drupal : Generate Drupal project with composer package in /tmp/composer-project (this may take a while).] ***
fatal: [localhost-discourseanalysis]: FAILED! => {"changed": true, "cmd": ["/usr/bin/composer", "create-project", "drupal-composer/drupal-project:8.x-dev", "/tmp/composer-project", "--prefer-dist", "--stability", "dev", "--no-interaction"], "delta": "0:01:11.191304", "end": "2019-02-24 12:04:32.568372", "msg": "non-zero return code", "rc": 2, "start": "2019-02-24 12:03:21.377068", "stderr": "Error: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.\nError: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.\nInstalling drupal-composer/drupal-project (8.x-dev 4229acea4bb6181f421e8dd0e72a02ccdc98df1d)\n  - Installing drupal-composer/drupal-project (8.x-dev 4229ace): Downloading (connecting...)\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bDownloading (100%)         \b\b\b\b\b\b\b\b\b\nCreated project in /tmp/composer-project\nError: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.\n> DrupalProject\\composer\\ScriptHandler::checkComposerVersion\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nYour requirements could not be resolved to an installable set of packages.\n\n  Problem 1\n    - drupal/core 8.7.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.0-rc1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.0-beta2 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.0-beta1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.0-alpha1 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - drupal/core 8.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.\n    - Installation request for drupal/core ^8.6.0 -> satisfiable by drupal/core[8.6.0, 8.6.0-alpha1, 8.6.0-beta1, 8.6.0-beta2, 8.6.0-rc1, 8.6.1, 8.6.10, 8.6.2, 8.6.3, 8.6.4, 8.6.5, 8.6.6, 8.6.7, 8.6.8, 8.6.9, 8.6.x-dev, 8.7.x-dev].\n\n  To enable extensions, verify that they are enabled in your .ini files:\n    - /etc/php/7.3/cli/php.ini\n    - /etc/php/7.3/cli/conf.d/10-opcache.ini\n    - /etc/php/7.3/cli/conf.d/10-pdo.ini\n    - /etc/php/7.3/cli/conf.d/20-apcu.ini\n    - /etc/php/7.3/cli/conf.d/20-calendar.ini\n    - /etc/php/7.3/cli/conf.d/20-ctype.ini\n    - /etc/php/7.3/cli/conf.d/20-exif.ini\n    - /etc/php/7.3/cli/conf.d/20-fileinfo.ini\n    - /etc/php/7.3/cli/conf.d/20-ftp.ini\n    - /etc/php/7.3/cli/conf.d/20-gettext.ini\n    - /etc/php/7.3/cli/conf.d/20-iconv.ini\n    - /etc/php/7.3/cli/conf.d/20-json.ini\n    - /etc/php/7.3/cli/conf.d/20-phar.ini\n    - /etc/php/7.3/cli/conf.d/20-posix.ini\n    - /etc/php/7.3/cli/conf.d/20-readline.ini\n    - /etc/php/7.3/cli/conf.d/20-shmop.ini\n    - /etc/php/7.3/cli/conf.d/20-sockets.ini\n    - /etc/php/7.3/cli/conf.d/20-sysvmsg.ini\n    - /etc/php/7.3/cli/conf.d/20-sysvsem.ini\n    - /etc/php/7.3/cli/conf.d/20-sysvshm.ini\n    - /etc/php/7.3/cli/conf.d/20-tokenizer.ini\n    - /etc/php/7.3/cli/conf.d/20-yaml.ini\n  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.", "stderr_lines": ["Error: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.", "Error: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.", "Installing drupal-composer/drupal-project (8.x-dev 4229acea4bb6181f421e8dd0e72a02ccdc98df1d)", "  - Installing drupal-composer/drupal-project (8.x-dev 4229ace): Downloading (connecting...)\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bDownloading (100%)         \b\b\b\b\b\b\b\b\b", "Created project in /tmp/composer-project", "Error: \"curl\" PHP extension not loaded; Prestissmo Composer plugin disabled.", "> DrupalProject\\composer\\ScriptHandler::checkComposerVersion", "Loading composer repositories with package information", "Updating dependencies (including require-dev)", "Your requirements could not be resolved to an installable set of packages.", "", "  Problem 1", "    - drupal/core 8.7.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.9 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.8 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.7 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.10 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.0-rc1 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.0-beta2 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.0-beta1 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.0-alpha1 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - drupal/core 8.6.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.", "    - Installation request for drupal/core ^8.6.0 -> satisfiable by drupal/core[8.6.0, 8.6.0-alpha1, 8.6.0-beta1, 8.6.0-beta2, 8.6.0-rc1, 8.6.1, 8.6.10, 8.6.2, 8.6.3, 8.6.4, 8.6.5, 8.6.6, 8.6.7, 8.6.8, 8.6.9, 8.6.x-dev, 8.7.x-dev].", "", "  To enable extensions, verify that they are enabled in your .ini files:", "    - /etc/php/7.3/cli/php.ini", "    - /etc/php/7.3/cli/conf.d/10-opcache.ini", "    - /etc/php/7.3/cli/conf.d/10-pdo.ini", "    - /etc/php/7.3/cli/conf.d/20-apcu.ini", "    - /etc/php/7.3/cli/conf.d/20-calendar.ini", "    - /etc/php/7.3/cli/conf.d/20-ctype.ini", "    - /etc/php/7.3/cli/conf.d/20-exif.ini", "    - /etc/php/7.3/cli/conf.d/20-fileinfo.ini", "    - /etc/php/7.3/cli/conf.d/20-ftp.ini", "    - /etc/php/7.3/cli/conf.d/20-gettext.ini", "    - /etc/php/7.3/cli/conf.d/20-iconv.ini", "    - /etc/php/7.3/cli/conf.d/20-json.ini", "    - /etc/php/7.3/cli/conf.d/20-phar.ini", "    - /etc/php/7.3/cli/conf.d/20-posix.ini", "    - /etc/php/7.3/cli/conf.d/20-readline.ini", "    - /etc/php/7.3/cli/conf.d/20-shmop.ini", "    - /etc/php/7.3/cli/conf.d/20-sockets.ini", "    - /etc/php/7.3/cli/conf.d/20-sysvmsg.ini", "    - /etc/php/7.3/cli/conf.d/20-sysvsem.ini", "    - /etc/php/7.3/cli/conf.d/20-sysvshm.ini", "    - /etc/php/7.3/cli/conf.d/20-tokenizer.ini", "    - /etc/php/7.3/cli/conf.d/20-yaml.ini", "  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode."], "stdout": "", "stdout_lines": []}

Summary

A fresh vargant up, with php_version: "7.2" in config fails to get past the composer install. When I run php -v, I get PHP 7.3.2-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 8 2019 15:43:26) ( NTS ) Obviously, this one misses packages (at least the php-dom).

But running

alias php='/usr/bin/php7.2'
php -v
cd /tmp/composer-project
composer install

does not resolve the issue, error remains, addressing /etc/php/7.3 modules.

Running

sudo apt-get install php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-dev php7.3-dom php7.3-fpm php7.3-gd php7.3-imap php7.3-json php7.3-mbstring php7.3-opcache php7.3-sqlite3 php7.3-xml php7.3-yaml
composer install

gets the composer install running. But this was not supposed to happen at all and I am unsure how to proceed - if the state is clean.

Afterwards, vagrant provision runs all the way through. php -v resolves to an expected PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 8 2019 15:37:29) ( NTS ).

@bits-of-static bits-of-static changed the title Installing with php7.2 breaks at composer install, referencing 7.3 extensions Installing with php7.2 fails at composer install, referencing 7.3 extensions Feb 24, 2019
@geerlingguy
Copy link
Owner

Strange, the default is currently PHP 7.2 and it seems to work okay... do you have any differences in your config.yml? E.g. are you overriding packages or anything like that?

@bits-of-static
Copy link
Author

Overriding, no, not that I would know.
I only have solr_version: "7.4.0". So I enable java, solr. But Solr is not running on php.
Also xdebug and drupalconsole.
Nothing else. Plus php_version: "7.2", obviously.

@tommym9
Copy link

tommym9 commented Mar 18, 2019

I'm seeing a similar issue with the PHP versions.

I've updated to the latest version of Drupal VM (1.2.5) on Mac and when I re-provisioned I can see that ansible was checking for the 7.2 versions of everything:

TASK [geerlingguy.php-xhprof : Copy XHProf INI into various other conf folders.] ***
skipping: [tht] => (item=/etc/php/7.2/fpm/conf.d)
skipping: [tht] => (item=/etc/php/7.2/apache2/conf.d)
skipping: [tht] => (item=/etc/php/7.2/cli/conf.d)

(This was the second run through so I would expect to see skipped here)

But when I SSH in and run php -v I get: PHP 7.3.3-1+ubuntu16.04.1+deb.sury.org+1

When I run composer install --dry-run I can see the 7.3 version is being referenced:

Problem 1
    - alchemy/zippy 0.4.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - alchemy/zippy 0.4.3 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - Installation request for alchemy/zippy 0.4.3 -> satisfiable by alchemy/zippy[0.4.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.3/cli/php.ini
    - /etc/php/7.3/cli/conf.d/10-opcache.ini
    - /etc/php/7.3/cli/conf.d/10-pdo.ini
    - /etc/php/7.3/cli/conf.d/15-xml.ini
    - /etc/php/7.3/cli/conf.d/20-apcu.ini
    - /etc/php/7.3/cli/conf.d/20-calendar.ini
    - /etc/php/7.3/cli/conf.d/20-ctype.ini
    - /etc/php/7.3/cli/conf.d/20-dom.ini
    - /etc/php/7.3/cli/conf.d/20-exif.ini
    - /etc/php/7.3/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.3/cli/conf.d/20-ftp.ini
    - /etc/php/7.3/cli/conf.d/20-gettext.ini
    - /etc/php/7.3/cli/conf.d/20-iconv.ini
    - /etc/php/7.3/cli/conf.d/20-json.ini
    - /etc/php/7.3/cli/conf.d/20-phar.ini
    - /etc/php/7.3/cli/conf.d/20-posix.ini
    - /etc/php/7.3/cli/conf.d/20-readline.ini
    - /etc/php/7.3/cli/conf.d/20-shmop.ini
    - /etc/php/7.3/cli/conf.d/20-simplexml.ini
    - /etc/php/7.3/cli/conf.d/20-sockets.ini
    - /etc/php/7.3/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.3/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.3/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.3/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.3/cli/conf.d/20-wddx.ini
    - /etc/php/7.3/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.3/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.3/cli/conf.d/20-xsl.ini
    - /etc/php/7.3/cli/conf.d/20-yaml.ini

Cheers

Tom

@cloud-hybridforge
Copy link

I'm having the same issue as @tommym9. This occurs when running vagrant up to create a new box (I had just ran vagrant destroy on a box) I have "7.2" set in my config.yml file.

Once vagrant up is completed and I ssh in, and run php -v, I see:
PHP 7.3.3-1+ubuntu16.04.1+deb.sury.org+1.

Running composer global require drush/drush:7.* gave me an issue of curl extension not being installed and gave me a list of php 7.3 extensions like @tommym9.

Thankfully, when I run vagrant provision and ssh back into the box, it's back to PHP 7.2.16-1+ubuntu16.04.1+deb.sury.org+1 and I can run composer normally.

@eric-schmidt
Copy link

I'm having a very similar issue to @cloud-hybridforge and @tommym9; however, I'm not getting any failures on vagrant up, and re-provisioning does not seem to help get php to recognize the proper version, even after numerous tries. I'm not installing any extra packages, aside from uncommenting xdebug. Very odd indeed...

@fsnet
Copy link

fsnet commented May 11, 2019

I had the same issue on macOS with the old vagrant box geerlingguy/drupal-vm 1.0.2 which was automatically used pursuant to the config parameter vagrant_box: geerlingguy/drupal-vm because I've had used it for another VM before.

After updating to 2.0.0 with vagrant box update the creation of new VMs works flawlessly and the PHP Version PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 is correct from the beginning.

@sphela02
Copy link

I'm seeing a similar issue, using DrupalVM 4.9.2, wanting php 7.1, after "vagrant up", where the apache php version is correct (7.1), but the CLI version is php 7.3.

After a subsequent "vagrant provision", the php CLI version seems to switch to the correct PHP 7.1

I'm still working on finding the "smoking gun" for why this happens.

config.yml attached.
drupalvm.test.yml.txt

@ndouglas
Copy link

ndouglas commented Aug 20, 2019

My coworker and I are seeing the same issue as you, sphela02. I'm not sure if it's related to the original subject of this issue 🤔.

@Oli-Chowdhury
Copy link

i am seeing the same issue. Is there any update on this issue?

@geerlingguy
Copy link
Owner

I believe the above commit fixes this issue. Please try the latest master release and see if it's still an issue (I will be tagging a new release soon, as well).

@sphela02
Copy link

Excellent! I'll try it next week after the hurricane passes :)

@geerlingguy
Copy link
Owner

@sphela02 stay safe! Hopefully the whole storm diverts north...

dhaley pushed a commit to NREL/drupal-vm that referenced this issue Sep 4, 2019
…eerlingguy#1964: Purge php-common package when installing different PHP version.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants