0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PHPコマンドが使えない...

Last updated at Posted at 2023-05-29

エラー

% php -v
dyld[12345]: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicuio.69.dylib
  Referenced from: <12345678-1234-1234-1234-123456789012> /opt/homebrew/Cellar/php@7.4/7.4.27/bin/php
  Reason: tried: '/opt/homebrew/opt/icu4c/lib/libicuio.69.dylib' (no such file),

解決手順

この記事では、icu4cのバージョン69が必要となっているので、それをインストールします。
また、yournameとしている部分は、好きに変更して問題ありません。
また、ディレクトリ構成も環境により多少変わる場合があります。

1. タップを作成

タップとは、Homebrew経由で外部のパッケージを参照するための機能

ざっくり言えば、brewコマンドでinstallなどができないもの(前のバージョンのパッケージなど)をできるようにするためのもの

brew tap-new yourname/taps

2. タップに展開

brew extract icu4c yourname/taps --version 69

3. タップを使いインストール

brew install yourname/taps/icu4c@69

4. シンボリックリンクを貼る

自分の解釈としては、インストールしたファイルに紐づけられたファイルを置くみたいな感じ。
(icu4c@69の直下にあるファイルをicu4cの直下にあるようにする)

# ディレクトリ移動
cd /opt/homebrew/opt/icu4c/lib
# バージョン確認
ls ../../../icu4c@69
  # ↓↓↓ こんな感じに出力されるはず ↓↓↓
  # 69.1
# シンボリックリンクを貼る(先ほどの69.1を使う)
ln -s ../../../icu4c@69/69.1/lib/libicuio.69.1.dylib libicuio.69.dylib
ln -s ../../../icu4c@69/69.1/lib/libicui18n.69.1.dylib libicui18n.69.dylib
ln -s ../../../icu4c@69/69.1/lib/libicuuc.69.1.dylib libicuuc.69.dylib
ln -s ../../../icu4c@69/69.1/lib/libicudata.69.1.dylib libicudata.69.dylib
ln -s ../../../icu4c@69/69.1/lib/libicutest.69.1.dylib libicutest.69.dylib
ln -s ../../../icu4c@69/69.1/lib/libicutu.69.1.dylib libicutu.69.dylib
# シンボリックリンクが貼れたかの確認
ls -l . | grep 69.dy
  # ↓↓↓ こんな感じに出力されるはず ↓↓↓
  # abcde-xy-x  1 yourname  admin     48  5 29 12:00 libicudata.69.dylib -> ../../../icu4c@69/69.1/lib/libicudata.69.1.dylib
  # abcde-xy-x  1 yourname  admin     48  5 29 12:00 libicui18n.69.dylib -> ../../../icu4c@69/69.1/lib/libicui18n.69.1.dylib
  # abcde-xy-x  1 yourname  admin     46  5 29 12:00 libicuio.69.dylib -> ../../../icu4c@69/69.1/lib/libicuio.69.1.dylib
  # abcde-xy-x  1 yourname  admin     48  5 29 12:00 libicutest.69.dylib -> ../../../icu4c@69/69.1/lib/libicutest.69.1.dylib
  # abcde-xy-x  1 yourname  admin     46  5 29 12:00 libicutu.69.dylib -> ../../../icu4c@69/69.1/lib/libicutu.69.1.dylib
  # abcde-xy-x  1 yourname  admin     46  5 29 12:00 libicuuc.69.dylib -> ../../../icu4c@69/69.1/lib/libicuuc.69.1.dylib

5. 動作確認

% php -v
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?