13
12

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 3 years have passed since last update.

Laravel5.5 インストール

Last updated at Posted at 2019-11-13

####・Composerインストール
参考
CentOS7にComposerをインストールする
@inakadegaebal

####1. Laravel インストール

$composer create-project "laravel/laravel=5.5.*" --prefer-dist {インストールフォルダ名}

####2. .env 編集。

/.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE={データベース名}
DB_USERNAME={ID}
DB_PASSWORD={Password}

####3. /storageのパーミッション変更

/
$chmod 777 -R storage

####4. DBの191文字超エラー回避

app/Providers/AppServiceProvider.php
class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        //追記
        \Illuminate\Support\Facades\Schema::defaultStringLength(191);
    }
    ...

####5. publicを {アプリドメイン}/ でアクセス
Php laravel 5.5 project .htaccess file

/.htaccess
//ルートディレクトリに配置
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]
    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/$1 
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ server.php
</IfModule>

####おまけ

git初期設定
$git init
$git add .
$git commit -m 'start'
//Git-Hub マイリポジトリから URL をコピーしておく
$git remote add origin '{URL}'
$git push -u origin master
13
12
1

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
13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?