LoginSignup
1
1

More than 5 years have passed since last update.

Vagrant+VirtualBoxで作成した仮想マシンにPHPライブラリテスト用環境を構築する【2】

Last updated at Posted at 2017-02-09

Vagrant+VirtualBoxで作成した仮想マシンにPHPライブラリテスト用環境を構築する【1】
Vagrant+VirtualBoxで作成した仮想マシンにPHPライブラリテスト用環境を構築する【2】 ←イマココ
Vagrant+VirtualBoxで作成した仮想マシンにPHPライブラリテスト用環境を構築する【3】
Vagrant+VirtualBoxで構築した仮想マシンをBox化して復元する

Webサーバー(Apache)の設定

インストール

[vagrant@localhost ~]$ sudo yum -y install httpd

確認

[vagrant@localhost ~]$ httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Nov 14 2016 18:04:44

入ってるー

起動

[vagrant@localhost ~]$ sudo /etc/init.d/httpd start

確認

[vagrant@localhost ~]$ sudo /etc/init.d/httpd status
httpd (pid  2278) を実行中...

動いてるー

共有フォルダの設定

仮想マシン上の「/vagrant」フォルダとローカル上のvagrantfileを置いているフォルダ(今回は「libTestCentOSVM」)は共有されている!

[vagrant@localhost vagrant]$ ls
Vagrantfile                        <-----
[vagrant@localhost vagrant]$ logout      | 共有
libTestCentOSVM $ls                      | されている
Vagrantfile                        <-----

変更をlocalhostで即見れるようにするため、 webサーバーのドキュメントルートとシンボリックリンクを貼っておきます。

[vagrant@localhost ~]$ sudo rm -rf /var/www/html
[vagrant@localhost ~]$ sudo ln -fs /vagrant /var/www/html

以下のサイトを参考にSELinuxを無効にする
http://little-braver.com/552/

PHP5.6の設定

こちらを参考に設定。
http://qiita.com/ozawan/items/caf6e7ddec7c6b31f01e

確認

[vagrant@localhost html]$ php --version
PHP 5.6.30 (cli) (built: Jan 19 2017 07:57:06) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

OK:thumbsup:

MySQL5.7の設定

こちらを参考に設定。
http://qiita.com/UmedaTakefumi/items/924cdce7cfff083bf492

確認

[vagrant@localhost html]$ mysqld --version
mysqld  Ver 5.7.17 for Linux on x86_64 (MySQL Community Server (GPL))

:clap:

php-mysqlのインストールも忘れずに!

sudo yum --enablerepo=remi,remi-php56 install -y php-mysql




サーバー側の環境設定はこれで終わりー:neutral_face:
長くなるので別記事へ続く!!
Vagrant+VirtualBoxで作成した仮想マシンにPHPライブラリテスト用環境を構築する【3】

1
1
2

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
1