LoginSignup
2
0

More than 1 year has passed since last update.

CentOS7.9 にPHP7.4を導入する

Last updated at Posted at 2021-11-25

はじめに

Wordpress導入にあたっての前提の環境作成の一部です
CentOS7.4 にWordpress5.8を導入する

環境

  • CentOS 7.9
  • Apache 2.4
  • PHP 7.4

Apache導入

apacheをインストール

# yum -y install httpd httpd-tools httpd-devel mod_ssl

apache起動

# systemctl start httpd

サーバ起動時に自動開始するように設定

# systemctl enable httpd

PHP導入

リポジトリ追加
※CentOS7標準のPHPは古いのでリポジトリを追加

# yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm

PHP導入
とりあえず必要なものを追加(うちの環境ではこれくらいあればOK)

# yum install -y --enablerepo=remi-php74 php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd php-pecl-imagick php-pecl-imagick-devel php-pecl-zip php-mbstring php-xml php-pear

Apacheを再起動して適用

# systemctl restart httpd

これで完了です!!

追記:
PHPの情報を確認したい場合は、以下内容のphpファイル配置し確認可能

<?php
phpinfo();
?>

無題.png

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