LoginSignup
1
0

More than 5 years have passed since last update.

CakePHP3をMacにインストールする際に行ったこと

Last updated at Posted at 2016-03-11

cakephp3をmacにインストールする際に行ったことを備忘録としてまとめた記事です。

参考にしたサイト様

発生した問題

  • composerを用いてcakephpをインストールする際に以下のエラーが発生しました
    • エラーの主原因は extension-intlがないことらしい
  • composer create-project --prefer-dist cakephp/app bookmarker
    • エラー文
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    cakephp/cakephp 3.2.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    cakephp/cakephp 3.2.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    cakephp/cakephp 3.2.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    cakephp/cakephp 3.2.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    cakephp/cakephp 3.2.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    Installation request for cakephp/cakephp ~3.2 -> satisfiable by cakephp/cakephp[3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4].

解決策その1(☓)

  • cd /usr/lib/php
  • sudo php install-pear-nozlib.phar
    • Capitanの場合、SIPを無効にする必要あり
  • brew install icu4c
  • sudo pecl install intl
    • ICU libraries and headers path is: /usr/local/opt/icu4c/
  • sudo brew install autoconf
  • sudo brew install automake
  • $vi /etc/php.ini
    • 以下の行を付け加えた
    • extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so しかし、エラ―は直らず。

解決策その2(◯)

  • php.ini は上記のまま
  • curl -s https://getcomposer.org/installer | /Applications/XAMPP/bin/php
  • /Applications/XAMPP/bin/php composer.phar create-project --prefer-dist cakephp/app bookmarker

インストールできました。

疑問

  • 解決策1と2の違い
    • usr/bin/phpを使うか/Applications/XAMPP/bin/phpを使うか
      • なぜ /Applications/XAMPP/bin/phpを使用するとうまくいくのか

なぜ解決策2でインストールができたのかが不明ですが、ひとまず解決です。

1
0
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
1
0