CentOSのcomposerがうまく動かない問題(一般ユーザー)

バージョン情報

CentOS

# cat /etc/centos-release
CentOS Stream release 8

Php

$ php -v
PHP 7.4.24

remiでのインストール

remiでインストールは、以下の記事と状況は同じ

エラーと解決方法

初期のエラー

エラーログ

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

PHPの設定変更

$ sudo dnf module install php:remi-7.4

しかし、

エラーになった。

The operation would result in switching of module 'php' stream '7.2' to stream 'remi-8.0'
Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.
It is recommended to rather remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.

このエラー事態を、

解決するために以下を実施。

sudo dnf module reset php

これでリセットされるので、

再度、以下を実際。

$ sudo dnf module install php:remi-7.4
===================================================================================================
 Package                Architecture     Version                      Repository              Size
===================================================================================================
Upgrading:
 php-common             x86_64           7.4.24-1.el8.remi            remi-modular           1.2 M
 php-json               x86_64           7.4.24-1.el8.remi            remi-modular            78 k
Installing group/module packages:
 php-cli                x86_64           7.4.24-1.el8.remi            remi-modular           4.6 M
 php-fpm                x86_64           7.4.24-1.el8.remi            remi-modular           1.6 M
 php-mbstring           x86_64           7.4.24-1.el8.remi            remi-modular           529 k
 php-xml                x86_64           7.4.24-1.el8.remi            remi-modular           217 k
Installing module profiles:
 php/common
Enabling module streams:
 php                                     remi-7.4
 :
 :
 :
Upgraded:
  php-common-7.4.24-1.el8.remi.x86_64               php-json-7.4.24-1.el8.remi.x86_64
Installed:
  php-cli-7.4.24-1.el8.remi.x86_64                   php-fpm-7.4.24-1.el8.remi.x86_64
  php-mbstring-7.4.24-1.el8.remi.x86_64              php-xml-7.4.24-1.el8.remi.x86_64
 :
 :
Complete!

スキルを使って、就職/転職/副業する時のサイト

プログラミングのスキルなどを、自分なりに高めた上で、

自分のスキルをアピールして就職や転職を行い、年収をあげるか、

副業という形で、年収にプラスアルファの稼ぎを増やすことはできます。

まずはできる範囲で取り組むことで、

少しずつ、経験値も増え、自分のスキルが収入につながるのでおすすめです。

おすすめ書籍

広告

おすすめ記事