1
0

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 5 years have passed since last update.

CakePHPのビルトインWebサーバー起動出来ない時はこれかも!

Last updated at Posted at 2020-01-02

はじめに

出来たことをすぐ忘れてしまうので書かせてください。:bow:
$はコマンドの前に書いてあるだけなので打たないでください。:bow:

これしたい

CakePHPのビルトインサーバー起動したい!
$ php ./bin/cake.php server
とか
$ bin/cake server
いうコマンドの実行

エラー例

PHP Fatal error:  require(): Failed opening required '/Users/***/***/******/mycakeapp/vendor/autoload.php' 
....一部省略....
bin/cake.php on line 5

:frowning2:binフォルダのcake.phpの5行目にvendorフォルダにあるautoload.phpを読み込みたいって書いてあるのに読み込めません
:relaxed:ないもん!インストールでつまづいたのに強行突破しようとして!:imp:

Problem 1
....一部省略....requires ext-intl ....一部省略....

:frowning2:intlありません
:relaxed:ないもん!

解決(!大事!)

私はintlが入れば無事に出来ました。
段階をおって説明します。
ちなみにintl入れたらcakePHPのプロジェクトも入れなおしてください。
入れなおしてターミナルも再起動した方がいいかと思います。

intlってなに?

:relaxed:国際化用拡張モジュールです。詳細は以下URL↓
https://www.php.net/manual/ja/intro.intl.php

intlってどうすれば入れられるの?

:relaxed:PHP 5.3.0 以降に勝手に入っているからそれ以降のPHPを入れればいいの!詳細は以下URL↓
https://www.php.net/manual/ja/intl.installation.php

macのHomebrewで入れたいのどうすればいいの?

:relaxed:PHP 5.3.0 以降入れればいいの!詳細は以下URL↓
https://qiita.com/Yorinton/items/67e377406fa2a55dbb87

:relaxed:もう少し詳しく説明するね!
$ php -m | grep intl
ってやってintlが入っていないだろうから入れるの。

:relaxed:PHPみて最新何があるかなって見るの。PHP 7.2.26 Releasedっとか書いてあったので以下うつの
$ brew install php@7.2

:relaxed:終わったら使えるようにパス通すように以下うつの

$ echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile

:relaxed:入ったかな?って確認するのintlって出てきたらOKなの!
$ php -m | grep intl

最後に

ちゃんと理解して進まないとほんとダメですね(/ω\)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?