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

OSXでCakePHP3のインストール補足

Last updated at Posted at 2015-01-21

普通にコンポーザーを使って以下のようにCakePHP3のインストールを試みると、

php composer.phar create-project --prefer-dist -s dev cakephp/app myapp

以下のように途中でパーミッションのエラーになる。

  - Installing psr/log (1.0.0)


                                            
  [ErrorException]                          
  touch(): Utime failed: Permission denied  

そこでsudo使ってやると、

sudo php composer.phar create-project --prefer-dist -s dev cakephp/app myapp

インストールは成功するが、所有者がrootになってしまう。

ls -al 
total 2592
drwxr-xr-x  25 mymac  staff      850  1 21 11:33 .
drwxr-xr-x   6 mymac  staff      204  1  9  2014 ..
-rw-r--r--@  1 mymac  staff    15364 12  6 10:41 .DS_Store
drwxr-xr-x  21 root         staff      714  1 21 11:33 myapp

なので以下のコマンドで元に戻す。

sudo chown -R mymac:staff myapp

あとついでだけど、インストールしたままだとタイムゾーンがUTCなので変更しておく。

config/bootstrap.php
/**
 * Set server timezone to UTC. You can change it to another timezone of your
 * choice but using UTC makes time calculations / conversions easier.
 */
date_default_timezone_set('Asia/Tokyo');
0
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
0
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?