0
0

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.

nginx に laravel 8 を インストール

Posted at

1.フォルダへ移動
2.twikon.clubフォルダを自動で新規作成
3.その中にlaravelをインスコ


cd /var/www/html/
composer create-project laravel/laravel twikon.club


アクセス権を設定し、リネーム


chmod 0755 twikon.club
cd twikon.club

//リネーム
mv server.php index.php

//ログ書き出せないってエラーが出るので
chmod -R 777 storage

たったこれだけでOK。
arsitanっていうビルトインサーバーは使わないので
server.phpをindex.phpに変更。

nginxの設定


server {
    server_name twikon.club;


location / {
       root  /var/www/html/twikon.club/public;
       index index.php index.html index.htm;
# get や post の値が取得できない場合はここで調整
#       try_files $uri $uri/ /index.php$query_string;
       try_files $uri $uri/ /index.php$is_args$args;
}


location ~ \.php$ {

       fastcgi_pass   unix:/var/run/php-fpm/www.sock;
       fastcgi_index  index.php;
# fastcti_param の フォルダ名を変更するの忘れずに
       fastcgi_param  SCRIPT_FILENAME /var/www/html/twikon.club$fastcgi_script_name;
       include        fastcgi_params;
 }


//SSLの設定とか
}

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?