Help us understand the problem. What is going on with this article?

【PHP】php-fpm環境の任意のPHP(7.2)でLaravelをインストール

More than 1 year has passed since last update.

公式とかに書いてるのと違う部分は
・PHPを常に指定する
・Laravelのバージョンを指定する(PHP7.2はMcryptとかで躓くため5.6を使用)
・composer.pharも展開したバージョンでのみ使用する
だけです…

Composer インストール

https://getcomposer.org/download/

# composer インストーラをダウンロード
/usr/local/php/7.2.6/bin/php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

# composer 正しくダウンロードできたかチェック
/usr/local/php/7.2.6/bin/php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

# composer インストーラを実行
/usr/local/php/7.2.6/bin/php composer-setup.php

できたcomposer.pharはそのまま使います。

Laravel インストール

https://laravel.com/docs/5.6/installation

# laravel を展開するフォルダへ移動し、
# さっきのcomposer.pharでバージョンを指定してプロジェクトを作成
# (指定した名称のディレクトリができます。下記はlaravel-demo)
/usr/local/php/7.2.6/bin/php -d memory_limit=2G /path/to/sakkino/composer.phar create-project "laravel/laravel=5.6.*" laravel-demo

// laravelサーバ起動
/usr/local/php/7.2.6/bin/php artisan serve

あとはアクセスして確認
http://example.com/path/to/laravel-demo/public/

余談

AWSで色々入れてメモリ足りなかったとき
一時的にSwap領域を増やした

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away