LoginSignup
0
0

More than 3 years have passed since last update.

Windows + Vagrant で CakePHP

Posted at

かなり昔の作業メモです。

Ubuntu環境

WindowsのコマンドはPowerShellを使った
適当にディレクトリを作成してそこに移動
boxはすでに持っていたので、initから

> vagrant init ubuntu/xenial64

Vagrantfile ができる

> Vagrant up

Ubuntu起動

各種パッケージ

Apache
本体とPHP用モジュール

$ apt-get install -y apache2
$ apt-get install -y libapache2-mod-php7.0

PHP
本体とCakeで必要なモジュール

$ apt-get install -y php7.0 php7.0-intl php7.0-mbstring php7.0-xml

Zip
無ければ入れる、Cakeの解凍に必要

$ apt-get install -y zip unzip

Composer

$ curl -s https://getcomposer.org/installer | php

CakePHP

$ mkdir ../../vagrant/cakephp
$ php composer.phar create-project --prefer-dist cakephp/app ../../vagrant/cakephp

Apache設定

AllowOverride を None から All に変更
/etc/apache2/apache2.conf

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

mod_rewriteを有効化

$ sudo a2enmod rewrite

Apacheをserviceコマンドで起動

$ sudo service apache2 start

なおVagrantの共有フォルダ設定によって、Apache2のルートディレクトリである /var/www/html の中にCakeディレクトリを配置してある

動作確認

ホストで http://localhost:8080/cakephp/ へアクセスしてみて、Cakeの画面が表示されればOK

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