$ sudo curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ cd /var/www/html/
$ composer create-project laravel/laravel project_name "5.1.*"
$ cd /var/www/html/
$ composer require laravel-ja/comja5
$ composer update
$ /home/ec2-user/.composer/vendor/bin/comja5 -a
・project_name/config/app.phpの編集
$ sudo vi project_name/config/app.php
--------------------------------
'debug' => env('APP_DEBUG', true),
'url' => 'http://~~~',
'timezone' => 'Asia/Tokyo',
'locale' => 'ja',
--------------------------------
・project_name/config/database.phpの編集
$ sudo vi project_name/config/database.php
--------------------------------
~
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'database_name'),
'username' => env('DB_USERNAME', 'database_user'),
'password' => env('DB_PASSWORD', 'database_password'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
~
--------------------------------
・ディレクトリの権限変更
$ sudo chown -R apache:apache /var/www/html/project_name/storage
$ sudo chmod 775 /var/www/html/project_name/storage
$ sudo chown -R apache:apache /var/www/html/project_name/bootstrap/cache
$ sudo chmod 775 /var/www/html/project_name/bootstrap/cache
Build a laravel of php framework environment using the EC2
$ sudo curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ cd /var/www/html/
$ composer create-project laravel/laravel project_name "5.1.*"
$ cd /var/www/html/
$ composer require laravel-ja/comja5
$ composer update
$ /home/ec2-user/.composer/vendor/bin/comja5 -a
・project_name/config/app.php edit
$ sudo vi project_name/config/app.php
--------------------------------
'debug' => env('APP_DEBUG', true),
'url' => 'http://~~~',
'timezone' => 'Asia/Tokyo',
'locale' => 'ja',
--------------------------------
・project_name/config/database.php edit
$ sudo vi project_name/config/database.php
--------------------------------
~
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'database_name'),
'username' => env('DB_USERNAME', 'database_user'),
'password' => env('DB_PASSWORD', 'database_password'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
~
--------------------------------
・change permissions of directory
$ sudo chown -R apache:apache /var/www/html/project_name/storage
$ sudo chmod 775 /var/www/html/project_name/storage
$ sudo chown -R apache:apache /var/www/html/project_name/bootstrap/cache
$ sudo chmod 775 /var/www/html/project_name/bootstrap/cache