NetCommos3をcomposerでインストール - NetCommons3/NetCommons3 GitHub Wiki

以下をインストールしておく

コマンド

$ git clone https://github.com/NetCommons3/NetCommons3.git
$ cd NetCommons3

NetCommons3ディレクトリにcomposerをインストールしてから、下記実行

$ php composer.phar install --no-dev
php.ini allow_url_fopen=0の時
$ php -d allow_url_fopen=1 composer.phar install --no-dev
エラー1の場合
$ php composer.phar install

  Problem 1
    - Installation request for cakephp/cakephp 2.10.1 -> satisfiable by cakephp/cakephp[2.10.1].
    - cakephp/cakephp 2.10.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

php-mcryptがインストールされてない

対応1

php-mcryptをインストール

CentOS7 epelリポジトリを使う場合
$ sudo yum install epel-release
$ sudo yum install --enablerepo=epel libmcrypt
$ sudo yum install --enablerepo=epel php-mcrypt
CentOS7 remi-php70リポジトリを使ってる場合
$ sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
$ sudo yum install --enablerepo=epel libmcrypt
$ sudo yum install --enablerepo=remi-php70 php-mcrypt
エラー2の場合
$ php composer.phar install
Downloading (failed)    Failed to download doctrine/annotations from dist: The "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535" file could not be downloaded: allow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in the server configuration by allow_url_fopen=0

php.iniでallow_url_fopen=0になっている

対応2

一時的にallow_url_fopen=1にする

$ php -d allow_url_fopen=1 composer.phar install
windows

下記エラーがでます。composer.jsonにscriptsの記述があるが、Linuxとパスの区切り文字違いでwindowsは実行できない。

https://github.com/NetCommons3/NetCommons3/blob/822f89ed3beffbb6775878ad4a449c4adc12da57/composer.json#L57

bower installを実行するスクリプトなので、bower installを別途実行すればOK。

エラー
> php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file

(中略)

Generating autoload files
> app/Console/cake install.install install_bower
'app' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
Script app/Console/cake install.install install_bower handling the post-install-cmd event returned with error code 1
対応
$ bower install

NetCommons3をインストール

$ cd NetCommons3/app
$ Console/cake install.install

NetCommons3の一括アップデート

$ cd NetCommons3/app
$ Console/cake PluginManager.update_all update_all

link

https://nc2.netcommons.org/ヘルプデスク/NetCommons3/バージョンアップ方法/