LoginSignup
0
0

More than 3 years have passed since last update.

VPS+CentOSに簡易的にPHP+Laravelの環境を作る

Posted at

概要

今回たまたま客先がcentosだったので、少ないcentos力を駆使して瞬間風速的に構築。
ci環境とか皆無なので、後々やっていこう。

環境設定

ログイン

ssh root@[任意のIPアドレス]

少しずつやりたいことによって出る問題違うと思う。

//centos用
yum update
yum install --enablerepo=remi,remi-php70 php php-devel php-mbstring php-pdo php-gd php-xml php-mcrypt
yum install --enablerepo=remi-php73 php-mbstring php-openssl php-xml unzip
yum install -y bash gcc make libpng-devel emacs tmux node npm libpng-devel php70-php-mbstring php-zip
yum update
//npm用
sudo npm install quasar-cli -g

php.ini書き換え

sudo emacs /etc/php.ini
php.ini
date.timezone = "Asia/Tokyo"

mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
mbstring.http_input = UTF-8
mbstring.http_output = pass
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_charset = none

composerが無い場合

curl -sS https://getcomposer.org/installer | php

laravelのプロジェクト配下に移動してcomposerのライブラリを入れる。

composer install
or
composer update

vuejs側の対応。

npm install
npm run dev

例えば8080ポートを開ける。ポート空いてるか確認するには

nmap [ipアドレス]

で調べれる。いわゆるポートスキャン。

sudo firewall-cmd  --permanent --add-port=8080/tcp
sudo firewall-cmd --reload

ポート空いてることを確認。

sudo firewall-cmd --list-all

ララベル起動。

php artisan serve --host=[ipアドレス] --port=8080

アクセスしてなんか動いてるはず。

http://[ipアドレス]:8080

以上 本当簡易的な環境作成。
docker使いたいー とか aws使いたいーとか
あると思う。
後々やっていこう。

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