• notice
  • Congratulations on the launch of the Sought Tech site

CentOS 7 yum install PHP7.3

Install PHP
Remi software source
Remi software source mainly provides the latest version of PHP package and some other PHP extension toolkit, it is for Fedora and RHEL branch variants (including: RHEL, CentOS, Oracle Linux, etc.) To install PHP, The Remi software source is recommended. Remi is very active in supporting and updating PHP, and can get new version support as soon as possible.

Install EPEL sources and source management tools:

yum install epel-release yum-utils
installs the REMI sources:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
install PHP7.3 and extensions:

yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73 -php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-pecl-swoole php73-php-recode php73-php-snmp php73-php-soap php73-php -xmll

php73 -v #View version

systemctl enable php73-php-fpm #Turn on self-starting at boot

systemctl restart php73-php-fpm #restart

systemctl start php73-php-fpm #Start

systemctl stop php73-php-fpm #Close

systemctl status php73-php-fpm #Check status
configuration file path:

#Find php.ini location:

find /etc/opt/remi/php73 -name php.ini

# The current PHP memory limit is below the recommended value of 512MB.

vi /etc/opt/remi/php73/php.ini

memory_limit = 512M

#If you are running nginx instead of apache, modify

vi /etc/opt/remi/php73/php-fpm.d/www.conf



# Replace the values with

user = nginx

group = nginx

#Find php and extension installation packages:

rpm -qa | grep 'php'

#View the installation path of php73-php-pecl-swoole4-4.4.15-1.el7.remi.x86_64:

rpm -ql php73-php-pecl-swoole4-4.4.15-1.el7.remi.x86_64
set php:

# Link php73 to the system environment variable, you can use php -v

ln -s /opt/remi/php73/root/usr/bin/php /usr/bin/php

# Set cgi.fix_pathinfo to 0

sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini

For cgi.fix_pathinfo options, please see (https://taobig.org/?p=650)

Potential vulnerability risks, for questions about security risks, please check (http://www.laruence.com/2010/05/20/1495.html)
to install more extensions:

Currently only some PHP extensions are installed, more extensions can be found here:

yum search php73 to
update PHP:

yum update #Update all software that can be updated, including PHP

Original author: arunfung transferred from the
link: https://learnku.com/articles/40202Copyright
notice: The copyright belongs to the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please keep the above author information and original link.


Technical otaku

Sought technology together

Related Topic


Leave a Reply