CentOS PHP/MySQLのインストール

ServersManのシンプルセットや素のCentOSでPHP/MySQLをインストールする。

・EPELとRemiリポジトリをインストール

CentOS 5.x 32bitの場合:

$ sudo rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

$ sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

CentOS 5.x 64bitの場合:

$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

$ sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

 

※「/etc/yum.repos.d/remi.repo」の中で、「enabled=0」となっているのでRemiは無効状態。

「enabled=1」にする代わりに、「–enablerepo=remi」をyumの引数に追記してPHPをインストールします。

・インストールされるPHPのバージョンを事前確認

$ sudo yum –enablerepo=remi info php

  Arch : i386が32bit用、Arch : x86_64が64bit用

Available Packages
Name : php
Arch : i386
Version : 5.3.21
Release : 14.el5.art
Size : 2.7 M
Repo : atomic
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP
: also offers built-in database integration for several commercial
: and non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.

Name : php
Arch : x86_64
Version : 5.4.11
Release : 1.el5.remi
Size : 3.1 M
Repo : remi
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP and Zend and BSD
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
: easy for developers to write dynamically generated web pages. PHP
: also offers built-in database integration for several commercial
: and non-commercial database management systems, so writing a
: database-enabled webpage with PHP is fairly simple. The most common
: use of PHP coding is probably as a replacement for CGI scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.

・PHPをインストール

$ sudo yum –enablerepo=epel,remi -y install php php-mbstring php-xml php-gd php-mysql

 

・インストールされるMySQLのバージョンを事前確認

$ sudo yum –enablerepo=remi info mysql

  Arch : i386が32bit用、Arch : x86_64が64bit用

Available Packages
Name : mysql
Arch : i386
Version : 5.5.30
Release : 15.el5.art
Size : 7.6 M
Repo : atomic
Summary : MySQL client programs and shared libraries
URL : http://www.mysql.com
License : GPLv2 with exceptions
Description: MySQL is a multi-user, multi-threaded SQL database server. MySQL is
: a client/server implementation consisting of a server daemon
: (mysqld) and many different client programs and libraries. The base
: package contains the standard MySQL client programs and generic
: MySQL files.

Name : mysql
Arch : x86_64
Version : 5.5.30
Release : 15.el5.art
Size : 7.4 M
Repo : atomic
Summary : MySQL client programs and shared libraries
URL : http://www.mysql.com
License : GPLv2 with exceptions
Description: MySQL is a multi-user, multi-threaded SQL database server. MySQL is
: a client/server implementation consisting of a server daemon
: (mysqld) and many different client programs and libraries. The base
: package contains the standard MySQL client programs and generic
: MySQL files.

・MySQLをインストール

$ sudo yum –enablerepo=remi install mysql-server mysql

 

・自動起動設定

$ sudo /sbin/chkconfig mysqld on

 

コメント

  1. Spoovaffibiob より:

    Amazing Post.thanks for share..alot more wait ..

    retro jordans

タイトルとURLをコピーしました