--Summary of how to install PHP on CentOS 7 machine
--Hardware environment
item | information |
---|---|
OS | CentOS 7 (7.8.2003) |
hardware | Dell Studio 1537 |
Processor | Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz |
memory | 4 GB DDR3 |
Graphics | unknown |
--The CentOS 7 machine must be built using the method below or the method described below. -Install Cent0S7 on your PC
--The command introduced in the explanation is executed by connecting from the client PC (Mac) using SSH.
--You can install PHP on a CentOS 7 PC, which is premised on building a Laravel environment.
Add and install repositories
Execute the following command to add the repository.
```terminal
$ sudo yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
```
Execute the following command to install the necessary items.
```terminal
$ sudo yum install --enablerepo=remi-php74 php74 php
$ sudo yum install --enablerepo=remi-php74 php-fpm
$ sudo yum install --enablerepo=remi-php74 php-mbstring
$ sudo yum install --enablerepo=remi-php74 php-mysqlnd
$ sudo yum install --enablerepo=remi-php74 php-pecl-zip
$ sudo yum install --enablerepo=remi-php74 php-xml
```
Confirmation
Execute the following command to display the installed package named php.
```terminal
$ yum list installed | grep php
```
Below is the information of the installed package named php in my environment.
```terminal
oniguruma5php.x86_64 6.9.5+rev1-2.el7.remi @remi-safe
php.x86_64 7.4.8-2.el7.remi @remi-php74
php-cli.x86_64 7.4.8-2.el7.remi @remi-php74
php-common.x86_64 7.4.8-2.el7.remi @remi-php74
php-fpm.x86_64 7.4.8-2.el7.remi @remi-php74
php-json.x86_64 7.4.8-2.el7.remi @remi-php74
php-mbstring.x86_64 7.4.8-2.el7.remi @remi-php74
php-mysqlnd.x86_64 7.4.8-2.el7.remi @remi-php74
php-pdo.x86_64 7.4.8-2.el7.remi @remi-php74
php-pecl-zip.x86_64 1.19.0-1.el7.remi.7.4 @remi-php74
php-sodium.x86_64 7.4.8-2.el7.remi @remi-php74
php-xml.x86_64 7.4.8-2.el7.remi @remi-php74
php74.x86_64 1.0-3.el7.remi @remi-safe
php74-php-cli.x86_64 7.4.8-2.el7.remi @remi-safe
php74-php-common.x86_64 7.4.8-2.el7.remi @remi-safe
php74-php-json.x86_64 7.4.8-2.el7.remi @remi-safe
php74-runtime.x86_64 1.0-3.el7.remi @remi-safe
```
If the same package as above is installed, the work of this article is completed.
-Procedure to install PHP 7.2 on CentOS 7 with yum
Recommended Posts