magento / devdocs

[Deprecated] Magento Developer Documentation
Open Software License 3.0
674 stars 1.76k forks source link

List of 'minimal' required PHP extensions does not include all dependencies required by Composer #2426

Closed ProcessEight closed 6 years ago

ProcessEight commented 6 years ago

This issue is a:

Description:

The DevDocs page https://devdocs.magento.com/guides/v2.2/performance-best-practices/software.html#php-extensions suggests to remove all PHP extensions, except for a whitelist. However, if you do this and then try and run either composer install or the Magento 2 install command, both of them complain that required PHP extensions are missing.

Steps to reproduce

  1. Remove the following PHP extensions from your PHP installation (I'm using PHP-FPM 7.1.18): 1.1 php-xsl 1.2 php-zip
  2. Restart PHP
  3. Try run the composer install command. The error message I received was:

    composer install
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Your requirements could not be resolved to an installable set of packages.
    
    Problem 1
    - magento/framework 101.0.0 requires ext-xsl * -> the requested PHP extension xsl is missing from your system.
    - magento/framework 101.0.0 requires ext-xsl * -> the requested PHP extension xsl is missing from your system.
    - Installation request for magento/framework 101.0.0 -> satisfiable by magento/framework[101.0.0].
    
    To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/15-xml.ini
    - /etc/php/7.1/cli/conf.d/20-bcmath.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-curl.ini
    - /etc/php/7.1/cli/conf.d/20-dom.ini
    - /etc/php/7.1/cli/conf.d/20-gd.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-intl.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-mbstring.ini
    - /etc/php/7.1/cli/conf.d/20-mcrypt.ini
    - /etc/php/7.1/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-simplexml.ini
    - /etc/php/7.1/cli/conf.d/20-soap.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.1/cli/conf.d/20-wddx.ini
    - /etc/php/7.1/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
    You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
  4. Try running the Magento 2 install command:

    
    php -f bin/magento setup:install (arguments redacted)
    Starting Magento installation:
    File permissions check...
    [Progress: 1 / 549]
    Required extensions check...
    
    [Exception]                                
    Missing following extensions: 'xsl' 'zip'  

setup:install [--backend-frontname BACKEND-FRONTNAME] [--key KEY] [--db-host DB-HOST] [--db-name DB-NAME] [--db-user DB-USER] [--db-engine DB-ENGINE] [--db-password DB-PASSWORD] [--db-prefix DB-PREFIX] [--db-model DB-MODEL] [--db-init-statements DB-INIT-STATEMENTS] [-s|--skip-db-validation] [--http-cache-hosts HTTP-CACHE-HOSTS] [--session-save SESSION-SAVE] [--session-save-redis-host SESSION-SAVE-REDIS-HOST] [--session-save-redis-port SESSION-SAVE-REDIS-PORT] [--session-save-redis-password SESSION-SAVE-REDIS-PASSWORD] [--session-save-redis-timeout SESSION-SAVE-REDIS-TIMEOUT] [--session-save-redis-persistent-id SESSION-SAVE-REDIS-PERSISTENT-ID] [--session-save-redis-db SESSION-SAVE-REDIS-DB] [--session-save-redis-compression-threshold SESSION-SAVE-REDIS-COMPRESSION-THRESHOLD] [--session-save-redis-compression-lib SESSION-SAVE-REDIS-COMPRESSION-LIB] [--session-save-redis-log-level SESSION-SAVE-REDIS-LOG-LEVEL] [--session-save-redis-max-concurrency SESSION-SAVE-REDIS-MAX-CONCURRENCY] [--session-save-redis-break-after-frontend SESSION-SAVE-REDIS-BREAK-AFTER-FRONTEND] [--session-save-redis-break-after-adminhtml SESSION-SAVE-REDIS-BREAK-AFTER-ADMINHTML] [--session-save-redis-first-lifetime SESSION-SAVE-REDIS-FIRST-LIFETIME] [--session-save-redis-bot-first-lifetime SESSION-SAVE-REDIS-BOT-FIRST-LIFETIME] [--session-save-redis-bot-lifetime SESSION-SAVE-REDIS-BOT-LIFETIME] [--session-save-redis-disable-locking SESSION-SAVE-REDIS-DISABLE-LOCKING] [--session-save-redis-min-lifetime SESSION-SAVE-REDIS-MIN-LIFETIME] [--session-save-redis-max-lifetime SESSION-SAVE-REDIS-MAX-LIFETIME] [--cache-backend CACHE-BACKEND] [--cache-backend-redis-server CACHE-BACKEND-REDIS-SERVER] [--cache-backend-redis-db CACHE-BACKEND-REDIS-DB] [--cache-backend-redis-port CACHE-BACKEND-REDIS-PORT] [--page-cache PAGE-CACHE] [--page-cache-redis-server PAGE-CACHE-REDIS-SERVER] [--page-cache-redis-db PAGE-CACHE-REDIS-DB] [--page-cache-redis-port PAGE-CACHE-REDIS-PORT] [--page-cache-redis-compress-data PAGE-CACHE-REDIS-COMPRESS-DATA] [--base-url BASE-URL] [--language LANGUAGE] [--timezone TIMEZONE] [--currency CURRENCY] [--use-rewrites USE-REWRITES] [--use-secure USE-SECURE] [--base-url-secure BASE-URL-SECURE] [--use-secure-admin USE-SECURE-ADMIN] [--admin-use-security-key ADMIN-USE-SECURITY-KEY] [--admin-user ADMIN-USER] [--admin-password ADMIN-PASSWORD] [--admin-email ADMIN-EMAIL] [--admin-firstname ADMIN-FIRSTNAME] [--admin-lastname ADMIN-LASTNAME] [--cleanup-database] [--sales-order-increment-prefix SALES-ORDER-INCREMENT-PREFIX] [--use-sample-data] [--magento-init-params MAGENTO-INIT-PARAMS]


<!-- (REQUIRED) When this issue is resolved, what is the expected result/behavior? -->
## Expected result:
Composer updates the dependencies and no errors are output.
The Magento 2 install command is executed successfully with no errors.

<!-- (OPTIONAL) What would a solution for this issue look like? -->
## Possible solutions:
Update the list of 'minimal' PHP extensions in the Dev Docs to include the `php-xsl` and `php-zip` extensions.

<!-- (OPTIONAL) What other information can you provide about this issue? -->
## Additional information:
I reproduced this issue on Ubuntu Trusty 16.04.

PHP version:
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 11 2018 14:22:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.18-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Magento version: Magento Open Source v2.2.0 (I know that's not the latest version of Magento, but this problem appears in the DevDocs for 2.2.x, so I would've expected the advice to work on any version of 2.2 - though I've only tested it on 2.2.0).

Here is the relevant part of my composer.lock file:
```bash
{
            "name": "magento/product-community-edition",
            "version": "2.2.0",
            "dist": {
                "type": "zip",
                "url": "https://repo.magento.com/archives/magento/product-community-edition/magento-$
                "reference": null,
                "shasum": "720ce672ea6f192610ed91c289a1bcd89022c415"
            },
            "require": {
                "braintree/braintree_php": "3.22.0",
                "colinmollenhour/cache-backend-file": "1.4",
                "colinmollenhour/cache-backend-redis": "1.10.2",
                "colinmollenhour/credis": "1.6",
                "colinmollenhour/php-redis-session-abstract": "~1.2.2",
                "composer/composer": "1.4.1",
                "ext-ctype": "*",
                "ext-curl": "*",
                "ext-dom": "*",
                "ext-gd": "*",
                "ext-hash": "*",
                "ext-iconv": "*",
                "ext-intl": "*",
                "ext-mbstring": "*",
                "ext-mcrypt": "*",
                "ext-openssl": "*",
                "ext-pdo_mysql": "*",
                "ext-simplexml": "*",
                "ext-soap": "*",
                "ext-spl": "*",
                "ext-xsl": "*",
                "ext-zip": "*",
                "lib-libxml": "*",
                "magento/composer": "~1.2.0",
                "magento/framework": "101.0.0",
                "magento/language-de_de": "100.2.0",
                "magento/language-en_us": "100.2.0",
                "magento/language-es_es": "100.2.0",
                "magento/language-fr_fr": "100.2.0",
                "magento/language-nl_nl": "100.2.0",
                "magento/language-pt_br": "100.2.0",
                "magento/language-zh_hans_cn": "100.2.0",
                "magento/magento-composer-installer": ">=0.1.11",
                "magento/magento2-base": "2.2.0",
                "magento/module-admin-notification": "100.2.0",
                "magento/module-advanced-pricing-import-export": "100.2.0",
                "magento/module-authorization": "100.2.0",
                "magento/module-authorizenet": "100.2.0",
                "magento/module-backend": "100.2.0",
                "magento/module-backup": "100.2.0",
                "magento/module-braintree": "100.2.0",
                "magento/module-bundle": "100.2.0",
                "magento/module-bundle-import-export": "100.2.0",
                "magento/module-cache-invalidate": "100.2.0",
                "magento/module-captcha": "100.2.0",
                "magento/module-catalog": "102.0.0",
                "magento/module-catalog-import-export": "100.2.0",
                "magento/module-catalog-inventory": "100.2.0",
                "magento/module-catalog-rule": "101.0.0",
                "magento/module-catalog-rule-configurable": "100.2.0",
                "magento/module-catalog-search": "100.2.0",
                "magento/module-catalog-url-rewrite": "100.2.0",
                "magento/module-catalog-widget": "100.2.0",
                "magento/module-checkout": "100.2.0",
                "magento/module-checkout-agreements": "100.2.0",
                "magento/module-cms": "102.0.0",
                "magento/module-cms-url-rewrite": "100.2.0",
                "magento/module-config": "101.0.0",
                "magento/module-configurable-import-export": "100.2.0",
                "magento/module-configurable-product": "100.2.0",
                "magento/module-configurable-product-sales": "100.2.0",
                "magento/module-contact": "100.2.0",
                "magento/module-cookie": "100.2.0",
                "magento/module-cron": "100.2.0",
                "magento/module-currency-symbol": "100.2.0",
                "magento/module-customer": "101.0.0",
                "magento/module-customer-import-export": "100.2.0",
                "magento/module-deploy": "100.2.0",
                "magento/module-developer": "100.2.0",
                "magento/module-dhl": "100.2.0",
                "magento/module-directory": "100.2.0",
                "magento/module-downloadable": "100.2.0",
                "magento/module-downloadable-import-export": "100.2.0",
                "magento/module-eav": "101.0.0",
                "magento/module-email": "100.2.0",
                "magento/module-encryption-key": "100.2.0",
                "magento/module-fedex": "100.2.0",
                "magento/module-gift-message": "100.2.0",
                "magento/module-google-adwords": "100.2.0",
                "magento/module-google-analytics": "100.2.0",
                "magento/module-google-optimizer": "100.2.0",
                "magento/module-grouped-import-export": "100.2.0",
                "magento/module-grouped-product": "100.2.0",
                "magento/module-import-export": "100.2.0",
                "magento/module-indexer": "100.2.0",
                "magento/module-integration": "100.2.0",
                "magento/module-layered-navigation": "100.2.0",
                "magento/module-marketplace": "100.2.0",
                "magento/module-media-storage": "100.2.0",
                "magento/module-msrp": "100.2.0",
                "magento/module-multishipping": "100.2.0",
                "magento/module-new-relic-reporting": "100.2.0",
                "magento/module-newsletter": "100.2.0",
                "magento/module-offline-payments": "100.2.0",
                "magento/module-offline-shipping": "100.2.0",
                "magento/module-page-cache": "100.2.0",
                "magento/module-payment": "100.2.0",
                "magento/module-paypal": "100.2.0",
                "magento/module-persistent": "100.2.0",
                "magento/module-product-alert": "100.2.0",
                "magento/module-product-video": "100.2.0",
                "magento/module-quote": "101.0.0",
                "magento/module-reports": "100.2.0",
                "magento/module-require-js": "100.2.0",
                "magento/module-review": "100.2.0",
                "magento/module-robots": "100.2.0",
                "magento/module-rss": "100.2.0",
                "magento/module-rule": "100.2.0",
                "magento/module-sales": "101.0.0",
                "magento/module-sales-inventory": "100.2.0",
                "magento/module-sales-rule": "101.0.0",
                "magento/module-sales-sequence": "100.2.0",
                "magento/module-sample-data": "100.2.0",
                "magento/module-search": "100.2.0",
                "magento/module-security": "100.2.0",
                "magento/module-send-friend": "100.2.0",
                "magento/module-shipping": "100.2.0",
                "magento/module-sitemap": "100.2.0",
                "magento/module-store": "100.2.0",
                "magento/module-swagger": "100.2.0",
                "magento/module-swatches": "100.2.0",
                "magento/module-swatches-layered-navigation": "100.2.0",
                "magento/module-tax": "100.2.0",
                "magento/module-tax-import-export": "100.2.0",
                "magento/module-theme": "100.2.0",
                "magento/module-translation": "100.2.0",
                "magento/module-ui": "101.0.0",
                "magento/module-ups": "100.2.0",
                "magento/module-url-rewrite": "101.0.0",
                "magento/module-user": "101.0.0",
                "magento/module-usps": "100.2.0",
                "magento/module-variable": "100.2.0",
                "magento/module-vault": "101.0.0",
                "magento/module-version": "100.2.0",
                "magento/module-webapi": "100.2.0",
                "magento/module-webapi-security": "100.2.0",
                "magento/module-weee": "100.2.0",
                "magento/module-widget": "101.0.0",
                "magento/module-wishlist": "101.0.0",
                "magento/theme-adminhtml-backend": "100.2.0",
                "magento/theme-frontend-blank": "100.2.0",
                "magento/theme-frontend-luma": "100.2.0",
                "magento/zendframework1": "~1.13.0",
                "monolog/monolog": "^1.17",
                "oyejorge/less.php": "~1.7.0",
                "pelago/emogrifier": "0.1.1",
                "php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
                "phpseclib/phpseclib": "2.0.*",
                "ramsey/uuid": "3.6.1",
                "shopialfb/facebook-module": "2.0.0",
                "sjparkinson/static-review": "~4.1",
                "symfony/console": "~2.3, !=2.7.0",
                "symfony/event-dispatcher": "~2.1",
                "symfony/process": "~2.1",
                "tedivm/jshrink": "~1.1.0",
                "tubalmartin/cssmin": "4.1.0",
                "zendframework/zend-captcha": "^2.7.1",
                "zendframework/zend-code": "^3.1.0",
                "zendframework/zend-config": "^2.6.0",
                "zendframework/zend-console": "^2.6.0",
                "zendframework/zend-crypt": "^2.6.0",
                "zendframework/zend-db": "^2.8.2",
                "zendframework/zend-di": "^2.6.1",
                "zendframework/zend-eventmanager": "^2.6.3",
                "zendframework/zend-form": "^2.10.0",
                "zendframework/zend-http": "^2.6.0",
                "zendframework/zend-i18n": "^2.7.3",
                "zendframework/zend-json": "^2.6.1",
                "zendframework/zend-log": "^2.9.1",
                "zendframework/zend-modulemanager": "^2.7",
                "zendframework/zend-mvc": "~2.6.3",
                "zendframework/zend-serializer": "^2.7.2",
                "zendframework/zend-server": "^2.6.1",
                "zendframework/zend-servicemanager": "^2.7.8",
                "zendframework/zend-session": "^2.7.3",
                "zendframework/zend-soap": "^2.6.0",
                "zendframework/zend-stdlib": "^2.7.7",
                "zendframework/zend-text": "^2.6.0",
                "zendframework/zend-uri": "^2.5.1",
                "zendframework/zend-validator": "^2.6.0",
                "zendframework/zend-view": "^2.8.1"
            },
            "type": "metapackage",
            "license": [
                "OSL-3.0",
                "AFL-3.0"
            ],
            "description": "eCommerce Platform for Growth (Community Edition)"
        },

<!--
Thank you for taking the time to report this issue!
GitHub Issues should only be created for problems/topics related to this project's codebase.

Before submitting this issue, please make sure you are complying with our Code of Conduct:
https://github.com/magento/devdocs/blob/develop/.github/CODE_OF_CONDUCT.md

Issues that do not comply with our Code of Conduct or do not contain enough information may be closed at the maintainers' discretion.

Feel free to remove this section before creating this issue.
-->
mhauri commented 6 years ago

Thank you @ProcessEight for pointing this out and taking the time to create a detailed report. I've added the missing PHP extensions.