LoginSignup
34
34

More than 5 years have passed since last update.

CentOS6にてCakePHP3.0を動かすまでの覚書

Last updated at Posted at 2015-03-30

VirtualBoxにてCentOS6を立ち上げ、CakePHP3を動かすまでのメモ。


状況

CentOSはminimalでインストールしたまっさらな状態。
外部のネットワークにつながること。

システムを最新の状態に更新

yum update -y

cat /etc/centos-release
# CentOS release 6.6 (Final)

remiからPHP5.6をインストールする

参考
CentOSにPHP5.6をインストール

# EPELリポジトリを登録。
yum install -y epel-release

# remiリポジトリを登録
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

# PHP5.6をインストール
yum install --enablerepo=remi --enablerepo=remi-php56 -y php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

php -v
# PHP 5.6.7 (cli) (built: Mar 19 2015 15:09:09) 
# Copyright (c) 1997-2015 The PHP Group
# Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
#    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend 
# Technologies
#    with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans


# php-intl をインストール
yum install --enablerepo=remi --enablerepo=remi-php56 -y php-intl

Apacheをインストール


yum install -y httpd httpd-devel
service httpd start
chkconfig httpd on

# httpd.confを編集
vi /etc/httpd/conf/httpd.conf 

# 276行目あたり
# ServerNameのコメントアウトを外しておく
# 試験環境なのでServerNameは設定せず...
#ServerName www.example.com:80
ServerName www.example.com:80

# 330行目あたりから
# DocumentRootの設定にて

# Options Indexesを変更
Options All

# AllowOverrideを変更
AllowOverride All


# confファイルをテスト
httpd -t
# Syntax OK

# Apache再起動
service httpd restart

CakePHPをインストールするためにComposerをインストール

# Composerを取得
curl -s https://getcomposer.org/installer | php

# ローカルにダウンロードしたcomposer.pharファイルを
# /usr/local/bin にリネームして移動
mv composer.phar /usr/local/bin/composer

CakePHPをインストール


# ApacheのDocumentRootに移動
cd /var/www/html/

# Composerを用いて展開
# 時間がかかるので待つ
composer create-project --prefer-dist cakephp/app ./

ls
# README.md  bin  composer.json  composer.lock  config  index.php  logs  phpunit.xml.dist  plugins  src  tests  tmp  vendor  webroot

ブラウザで確認

CakePHP3.0

以上。
あとはコーディングしていく感じです。

34
34
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
34
34