UbuntuにLaravelのインストール

公式

composerのインストール

curl -sS https://getcomposer.org/installer | php
sudo   mv composer.phar /usr/local/bin/composer

laravelのインストール

composer global require "laravel/installer=~1.1"

path通す
~/.composer/vendor/binではないので注意

export PATH="$PATH:~/.config/composer/vendor/bin"

プロジェクト作成

laravel new hoge

keyの生成
The only supported ciphers are AES-128-CBC and AES-256-CBC

php artisan key:generate
php artisan config:clear

nginx

server {
    listen       80;
    server_name  hogehoge.com;


    root   /var/www/hoge/public;
    index  index.php;

    location / {
        index  index.php index.html index.htm;
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
      fastcgi_pass   unix:/run/php/php7.2-fpm.sock;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      include        fastcgi_params;
    }
}
カテゴリーPHP