やったこと

webサービスを作るときに考えたことを垂れ流します

アマゾンAWSで「php-devel」をインストールする!

アマゾンのEC2サーバーで「phpize」のコマンドを使おうとしたら、以下のようなエラーが出て怒られてしまいました。

#phpize

Can't find PHP headers in /usr/include/php/5.6/php
The php-devel package is required for use of this command.


どうも「php-devel」というパッケージがないとだめだと怒っているようです。
なので「php-devel」をインストールすることに。

#yum -y install php-devel

--> Finished Dependency Resolution
Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.8.amzn1.x86_64
Error: php56-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.31-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php56 conflicts with php-5.3.29-1.8.amzn1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


しかしyumでインストールしようとしても上記のようにエラーが出てどうしてもできません。これは大変なことです。

いろいろググって調べてみたら「yum install php56-devel」を使いなさいという外人のお言葉が。
amazon web services - not able to install php-devel in aws centos ec2 instance for php version 5.6.22 - Stack Overflow

言うとおりに「php56-devel」を入れてみたら、ちゃんと入りました。

#yum install php56-devel

Installed:
  php56-devel.x86_64 0:5.6.28-1.130.amzn1

Dependency Installed:
  autoconf.noarch 0:2.69-11.9.amzn1                          automake.noarch 0:1.13.4-3.15.amzn1
  m4.x86_64 0:1.4.16-9.10.amzn1                              pcre-devel.x86_64 0:8.21-7.7.amzn1
  perl-Test-Harness.noarch 0:3.28-3.6.amzn1                  perl-Thread-Queue.noarch 0:3.02-2.5.amzn1
  php56-jsonc-devel.x86_64 0:1.3.6-1.19.amzn1

Dependency Updated:
  php56.x86_64 0:5.6.28-1.130.amzn1                         php56-cli.x86_64 0:5.6.28-1.130.amzn1
  php56-common.x86_64 0:5.6.28-1.130.amzn1                  php56-intl.x86_64 0:5.6.28-1.130.amzn1
  php56-mbstring.x86_64 0:5.6.28-1.130.amzn1                php56-mysqlnd.x86_64 0:5.6.28-1.130.amzn1
  php56-pdo.x86_64 0:5.6.28-1.130.amzn1                     php56-process.x86_64 0:5.6.28-1.130.amzn1
  php56-xml.x86_64 0:5.6.28-1.130.amzn1

Complete!


親切な人のおかげでちゃんと「phpize」コマンドが使えるようになりました、よかったよかった。