2

I was trying to install a composer package and ran this command: php composer.phar require phpmailer/phpmailer. The response included this:

Failed to download phpmailer/phpmailer from dist: The zip extension and unzip/7z commands are both missing, skipping. Your command-line PHP is using multiple ini files. Run php --ini to show them. Now trying to download from source

Infact the package did download from source. I need to work out how to get unzipping to work but I also want to try and understand about the multiple ini files and what to do about it. I ran the command: php --ini:

ubuntu@ip-172-31-38-72:/var/www/html$ php --ini
Configuration File (php.ini) Path: /etc/php/8.1/cli
Loaded Configuration File:         /etc/php/8.1/cli/php.ini
Scan for additional .ini files in: /etc/php/8.1/cli/conf.d
Additional .ini files parsed:      /etc/php/8.1/cli/conf.d/10-opcache.ini,
/etc/php/8.1/cli/conf.d/10-pdo.ini,
/etc/php/8.1/cli/conf.d/20-calendar.ini,
/etc/php/8.1/cli/conf.d/20-ctype.ini,
/etc/php/8.1/cli/conf.d/20-exif.ini,
/etc/php/8.1/cli/conf.d/20-ffi.ini,
/etc/php/8.1/cli/conf.d/20-fileinfo.ini,
/etc/php/8.1/cli/conf.d/20-ftp.ini,
/etc/php/8.1/cli/conf.d/20-gettext.ini,
/etc/php/8.1/cli/conf.d/20-iconv.ini,
/etc/php/8.1/cli/conf.d/20-phar.ini,
/etc/php/8.1/cli/conf.d/20-posix.ini,
/etc/php/8.1/cli/conf.d/20-readline.ini,
/etc/php/8.1/cli/conf.d/20-shmop.ini,
/etc/php/8.1/cli/conf.d/20-sockets.ini,
/etc/php/8.1/cli/conf.d/20-sysvmsg.ini,
/etc/php/8.1/cli/conf.d/20-sysvsem.ini,
/etc/php/8.1/cli/conf.d/20-sysvshm.ini,
/etc/php/8.1/cli/conf.d/20-tokenizer.ini

I would like to know more about what to do about this situation. I thought that PHP could use more than one ini file.

Edit

It was suggested that Where can I find php.ini? and How can I find the php.ini file used by the command line? contained answers to my question but they do not. I am questioning why, in the context of a warning relating to a failed PHP command, I was informed that

[my] command-line PHP is using multiple ini files

I want to know why this was mentioned in relation to the failed PHP command I issued and whether I need to do something about it and if so what I should do.

3
  • Use phpinfo() or use php -i and check the console for (Loaded Configuration File =>). apart from those links Commented Sep 6, 2022 at 11:13
  • Each file is read in alphabetical order (that why 20- prefix) and overwrites previous set config or adds new ones. Commented Sep 6, 2022 at 11:13
  • 1
    Thanks both of you for your helpful comments. Is it actually a problem? The message I got implies it is a problem but is not explicit about that. Commented Sep 6, 2022 at 11:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.