2018年11月

php-pearのインストールにはepelを有効にする必要がある

この文書は2018/11/23時点の情報です。
php-pearをインストールしようとしたら、php-composer(fedora/autoloader)が必要でした。

[root@localhost localuser]# yum install php-pear
Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * remi-php71: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package php-pear.noarch 1:1.10.6-1.el7.remi will be installed
--> Processing Dependency: php-composer(fedora/autoloader) for package: 1:php-pear-1.10.6-1.el7.remi.noarch
--> Finished Dependency Resolution
Error: Package: 1:php-pear-1.10.6-1.el7.remi.noarch (remi-php71)
           Requires: php-composer(fedora/autoloader)
 You could try using --skip-broken to work around the problem

php-composer(fedora/autoloader)はepelにあるので、まずepelが使えるようにします。
epelのリポジトリを追加するためのrpmを持ってきます。
[root@localhost localuser]# wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
--2018-11-18 12:28:04--  https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Resolving dl.fedoraproject.org (dl.fedoraproject.org)... 209.132.181.24, 209.132.181.23, 209.132.181.25
Connecting to dl.fedoraproject.org (dl.fedoraproject.org)|209.132.181.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15080 (15K) [application/x-rpm]
Saving to: ‘epel-release-7-11.noarch.rpm’

100%[==================================================================================>] 15,080      --.-K/s   in 0.1s

2018-11-18 12:28:04 (109 KB/s) - ‘epel-release-7-11.noarch.rpm’ saved [15080/15080]

epelのリポジトリを追加するためのrpmをインストールします。
[root@localhost localuser]# rpm -Uvh epel-release-7-11.noarch.rpm
Preparing...                          ################################# [100%]
        package epel-release-7-11.noarch is already installed
[root@localhost localuser]# yum install php-fedora-autoloader
Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * remi-php71: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: ftp.iij.ad.jp
No package php-fedora-autoloader available.
Error: Nothing to do

epelのリポジトリを有効にするため、epel.repoのenabledを1にします。
[root@localhost localuser]# emacs /etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

php-fedora-autoloaderをインストールします。
[root@localhost localuser]# yum install php-fedora-autoloader
Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                 | 9.5 kB  00:00:00
 * base: ftp.iij.ad.jp
 * epel: www.ftp.ne.jp
 * extras: ftp.iij.ad.jp
 * remi-php71: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: ftp.iij.ad.jp
epel                                                                                                 | 3.2 kB  00:00:00
(1/3): epel/x86_64/group_gz                                                                          |  88 kB  00:00:00
epel/x86_64/updateinfo         FAILED                                                     ]  0.0 B/s |  88 kB  --:--:-- ETA
http://mirror2.totbb.net/epel/7/x86_64/repodata/4965e91e8ce6cc40f06cbce2777f2ef21bf69cae86e12e9c8d0b8c3375a4fcbc-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

(2/3): epel/x86_64/updateinfo                                                                        | 932 kB  00:00:00
(3/3): epel/x86_64/primary                                                                           | 3.6 MB  00:00:02
epel                                                                                                            12707/12707
Resolving Dependencies
--> Running transaction check
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================
 Package                                Arch                    Version                         Repository             Size
============================================================================================================================
Installing:
 php-fedora-autoloader                  noarch                  1.0.0-1.el7                     epel                  9.6 k

Transaction Summary
============================================================================================================================
Install  1 Package

Total download size: 9.6 k
Installed size: 15 k
Is this ok [y/d/N]: y
Downloading packages:
php-fedora-autoloader-1.0.0-1.el7.noarch.rpm                                                         | 9.6 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : php-fedora-autoloader-1.0.0-1.el7.noarch                                                                 1/1
  Verifying  : php-fedora-autoloader-1.0.0-1.el7.noarch                                                                 1/1

Installed:
  php-fedora-autoloader.noarch 0:1.0.0-1.el7

Complete!

php-pearをインストールします。
[root@localhost localuser]# yum install php-pear
Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: www.ftp.ne.jp
 * extras: ftp.iij.ad.jp
 * remi-php71: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package php-pear.noarch 1:1.10.6-1.el7.remi will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================
 Package                   Arch                    Version                                Repository                   Size
============================================================================================================================
Installing:
 php-pear                  noarch                  1:1.10.6-1.el7.remi                    remi-php71                  357 k

Transaction Summary
============================================================================================================================
Install  1 Package

Total download size: 357 k
Installed size: 2.1 M
Is this ok [y/d/N]: y
Downloading packages:
php-pear-1.10.6-1.el7.remi.noarch.rpm                                                                | 357 kB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:php-pear-1.10.6-1.el7.remi.noarch                                                                      1/1
  Verifying  : 1:php-pear-1.10.6-1.el7.remi.noarch                                                                      1/1

Installed:
  php-pear.noarch 1:1.10.6-1.el7.remi

Complete!

psqlで接続するポート番号を変更する

psqlコマンドはデフォルトで5432番ポートに接続する。
psql -p 5433とすると5433番ポートに接続する。
psqlで常に5433番ポートに接続するようにしたい場合は環境変数に
PGPORT=5433
を設定する。
具体的には
export PGPORT=5433
とコマンドをたたく。

bashの場合は、.bashrcに
export PGPORT=5433
と書いておけば、次回からログインした際に、psqlとうつと5433番ポートに接続してくれる。
記事検索