LoginSignup
0
1

More than 5 years have passed since last update.

mac上の仮想環境に構築したcentos7にPHPを導入する

Last updated at Posted at 2017-05-15

リポジトリの導入

centosの標準リポジトリにはないモジュールを導入するために外部リポジトリをインストールで利用するための登録をします。

EPELリポジトリ

EPELリポジトリをインストールします。

[vagrant@localhost ~]$ sudo yum install epel-release
〜省略〜
================================================================================
 Package                アーキテクチャー バージョン      リポジトリー      容量
================================================================================
インストール中:
 epel-release           noarch           7-9             extras            14 k
〜省略〜
インストール:
  epel-release.noarch 0:7-9                                                     

完了しました!

remiリポジトリ

remiリポジトリをインストールします。

[vagrant@localhost ~]$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
http://rpms.famillecollet.com/enterprise/remi-release-7.rpm を取得中
警告: /var/tmp/rpm-tmp.SPvaji: ヘッダー V4 DSA/SHA1 Signature、鍵 ID 00f97f56: NOKEY
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:remi-release-7.3-1.el7.remi      ################################# [100%]

PHPのインストール

[vagrant@localhost ~]$ sudo yum install --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd

[vagrant@localhost ~]$ 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

composerの導入

[vagrant@localhost ~]$ sudo curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...

Composer (version 1.4.1) successfully installed to: /home/vagrant/composer.phar
Use it: php composer.phar

composerをパスの通った場所へ移動します。

[vagrant@localhost ~]$ sudo mv composer.phar /usr/local/bin/composer

参考

macOS Sierra バージョン10.12.4
Vagrant 1.9.4
VirtualBox 5.1.22
CentOS 7.0 64bit
PHP 5.6.30
composer 1.4.1


シリーズ一覧 (vagrant centos LAMP環境構築)

1.macにvagrantでcentos7の仮想環境を構築したときの初期設定
2.mac上の仮想環境に構築したcentos7にPHPを導入する
3.mac上の仮想環境に構築したcentos7でPHPのビルトインサーバーを利用する
4.mac上の仮想環境に構築したcentos7にapahceを導入する
5.mac上の仮想環境に構築したcentos7にmysqlを導入する
6.centos7に導入したMySQL5.6の初期設定と動作確認

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