Composer errors when applying patches
When installing a new site with: LAMP: [res@svr ~]$ cat /proc/version Linux version 3.10.0-1160.88.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 (closed) SMP Tue Mar 7 15:41:52 UTC 2023
PHP: PHP Version 8.1.21 Directive Local Value Master Value allow_url_fopen On On allow_url_include Off Off
[res@svr ~]$ mysql -V mysql Ver 14.14 Distrib 5.7.43, for Linux (x86_64) using EditLine wrapper
Drupal:
[res@svr d9]$ composer create-project drupal/recommended-project:9.5.1 "../public_html/d9"
…..
Congratulations, you’ve installed the Drupal codebase
from the drupal/recommended-project template!
CiviCRM: Using Composer, all clean until CiviCRM install: [res@svr d9]$ composer clearcache Cache directory does not exist (cache-vcs-dir): Cache directory does not exist (cache-repo-dir): Cache directory does not exist (cache-files-dir): Clearing cache (cache-dir): ./.cache/composer All caches cleared. [res@svr d9]$ composer config extra.enable-patching true [res@svr d9]$ composer config minimum-stability dev [res@svr d9]$ composer require civicrm/civicrm-{core,packages,drupal-8}:'5.64.x-dev'
getting 12 errors like the 2 examples below:
-
- Applying patches for adrienrn/php-mimetyper
https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch (Update gitignore to ensure that sites that manage via git don't miss out on the important db.json file)
Could not apply patch! Skipping. The error was: The "https://patch-diff.githubusercontent.com/raw/adrienrn/php-mimetyper/pull/15.patch" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
-
- Applying patches for zetacomponents/mail
https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
Could not apply patch! Skipping. The error was: The "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0
failed to open stream: no suitable wrapper could be found)
We have checked and rechecked the allow_url_fopen and can be seen from the php.ini and the reported php parameters, this setting is On.
php.ini: allow_url_fopen = On display_errors = Off enable_dl = Off file_uploads = On max_execution_time = 30 max_input_time = 60 max_input_vars = 1000 memory_limit = 64M post_max_size = 8M session.gc_maxlifetime = 1440 session.save_path = "/var/cpanel/php/sessions/ea-php81" upload_max_filesize = 2M zlib.output_compression = Off
I would like to have a clean composer based install for this new site so we can avoid sins of the past sites which were not maintained via composer. I am not very familiar with composer but if there are things I can do to debug and provide feedback to the code base, I am happy to help. Thanks