0

I installed Xampp on ubuntu 20.04 and then tried to install composer globally with the follwing commands :

sudo apt update
sudo apt install php-cli unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

I get this error returned :

The phar extension is missing.
Install it or recompile php without --disable-phar

The iconv OR mbstring extension is required and both are missing.
Install either of them or recompile php without --disable-iconv

So I tried to see if the phar extension is activated, and it seems to be :

phar config:
enter image description here

The only odd thing I found is the location of the php.ini, in phpinfo() it tells me the path is :

php.ini path
enter image description here

But I get this result with php --ini :

php --ini
Configuration File (php.ini) Path: /etc/php/8.0/cli
Loaded Configuration File:         (none)
Scan for additional .ini files in: /etc/php/8.0/cli/conf.d
Additional .ini files parsed:      (none)

Edit: I also tried to uncomment extension=php_phar.dll and I added myself extension=phar.so

Tristan
  • 35
  • 6
  • Looks like you are using completely different versions of PHP for the webserver and the shell access – Nico Haase Nov 03 '21 at 07:47
  • what is the output of this command `php -m`? do you find the phar extension in this list? – hassan Nov 03 '21 at 08:01
  • ``` php -m [PHP Modules] Core date filter hash json libxml openssl pcntl pcre Reflection session sodium SPL standard zlib [Zend Modules] ``` It looks like i have 2 versions of php installed isn't it ? – Tristan Nov 03 '21 at 08:25
  • May be I should remove xampp entirely and reinstall everything – Tristan Nov 03 '21 at 08:28
  • `extension=php_phar.dll` won't have any effect on a Ubuntu system – Nico Haase Nov 03 '21 at 11:08

0 Answers0