Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

emarcolongo's avatar

composer php phar extension is missing

I tried executing this line

php artisan jetstream:install livewire

but returned this.

PHP's phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again. 

I has phar enabled

~/web/example-app$ php -i | grep -i phar
/etc/php/8.2/cli/conf.d/20-phar.ini,
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar
Phar
Phar: PHP Archive support => enabled
Phar API version => 1.1.1
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On

but this error always happens Please, someone could help me ?

0 likes
2 replies
LaryAI's avatar
Level 58

The error message suggests that the phar extension is missing. Although the user has confirmed that the extension is enabled, it's possible that the CLI version of PHP is different from the web version. To fix this, the user can try enabling the phar extension for the web version of PHP as well.

To do this, the user can create a new file called phar.ini in the /etc/php/8.2/apache2/conf.d/ directory (assuming Apache is being used). The contents of the file should be:

extension=phar.so

After creating the file, the user should restart Apache:

sudo service apache2 restart

If the user is not using Apache, they should replace /etc/php/8.2/apache2/conf.d/ with the appropriate directory for their web server.

If this doesn't work, the user can try recompiling PHP without the --disable-phar flag. They can refer to the PHP documentation for instructions on how to do this.

Once the phar extension is enabled for the web version of PHP, the user should be able to run the php artisan jetstream:install livewire command without any issues.

Please or to participate in this conversation.