1
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.

XAMMP Laravelで遊んだメモ

Last updated at Posted at 2021-02-18

Windows10 pro
PHP 7.4.11
Composer 1.10.20
Laravel 8.28.1
npm 7.5.4

#xamppインストール(php)

https://qiita.com/hitotch/items/0e1751ef38f83a9f3bf4

#Composerインストール

https://qiita.com/hitotch/items/927337632c7ae1f1963f

#Laravelインストーラーのインストール

https://readouble.com/laravel/8.x/ja/installation.html

composer global require laravel/installer

Windows インストール先: %USERPROFILE%\AppData\Roaming\Composer\vendor\bin

#Laravelアプリインストール(Laravelインストーラー

laravel new example-app

#Laravelアプリインストール(composer

composer create-project -–prefer-dist laravel/laravel example-app

–prefer-distはzipでインストール

#Laravelアプリ ローカル起動①

php artisan serve

#Laravelアプリ ローカル起動②
Xamppのhtdocsにlaravelアプリをインストール後xamppのApacheを起動

#Laravelのpublicフォルダを見せるためのApacheのconf設定
D:\xampp\apache\conf\httpd.conf の末尾に以下を追加
Listen 40555
(Listenするポートは既存のものと被らないようにする。

D:\xampp\apache\conf\extra\httpd-vhosts.conf の末尾に以下を追加

DocumentRoot "D:\xampp\htdocs\example-app\public" ServerName localhost AllowOverride All Options All Require all granted

VirtualHost:ドメイン:ポート(ポートはhttpd.confでListenしたものを指定する。
DocumentRoot:publicにするディレクトリ
ServerName:VirtualHostのドメインと同じ
Directory:DocumentRootと同じ

保存してApacheを再起動すると今まで「http://localhost/example-app/public」で見えていたものが「http://localhost:40555/」で見えるようになる。
ドメイン部分をlocalhostではなく適当なものにする方法もあるが、Windowsにhostsの例外を登録したりLaravelのAPP_URLを変更するのが手間なので省略(実運用では必要)

#bootstrapのインストール

https://mebee.info/2020/05/01/post-10614/

##laravel/ui導入

php -d memory_limit=-1 "C:\ProgramData\ComposerSetup\bin\composer.phar"  require laravel/ui

(メモリの話https://polidog.jp/2018/02/04/php-memory/

##bootstrap導入

php artisan ui bootstrap
npm install
npm run dev

##cssタグ

<link href="{{ asset('css/app.css') }}" rel="stylesheet">

##Honoka

https://gn-office.pro/archives/343

1
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
1
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?