5
8

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

Ubuntu に Laravel をインストールする

Last updated at Posted at 2018-05-29

Laravel を始めようと思っが
installに手こずったのでメモ

まず、php をインストール

sudo apt install php

Composer インストールする

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Composer path

sudo mv composer.phar /usr/local/bin/composer

Laravel インストール

composer global require "laravel/installer"

Laravel にpathをとおす

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

をhomeにある.bashrcに追加し

source ~/.bashrc 

Ubuntuのバージョンによってはこっちかもしれません

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

走らせる

php artisan serve

Screenshot from 2018-05-29 18-17-09.png
おぉ!!カッコイイ

#参考リンク
https://getcomposer.org/
https://getcomposer.org/doc/00-intro.md#globally
http://laravel.jp/
https://laravel.com/docs/4.2/quick
https://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your

5
8
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
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?