How to install PHP7 on CentOS78
This article will introduce to you how to install PHP7 on CentOS78. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
1. The default PHP version of CentOS7 is PHP5, but if we want to install PHP7, we do not need to delete the existing PHP5, just upgrade PHP to PHP7.
Use the yum provides php command to obtain the CentOS7 PHP package installation status. What is shown is that the latest version that can be installed in the existing installation source is: php-5.4.16-46.el7.x86_64
2. Before installing PHP7, it is recommended to upgrade and update the CentOS7 installation package first. :
yum -y update: Upgrade all software packages and also upgrade the software and system kernel;
yum -y upgrade: Just upgrade all software packages, but not upgrade the software and system kernel.
We use the second item here: yum -y upgrade to upgrade.
After completion, restart httpd: systemctl restart httpd.service: Restart httpd.
Usage: index.php phpinfo(): Test, no php information page is displayed, indicating that php configuration is required.
3. Use: yum remove php-common -y: Remove the php-common installed on CentOS7 so that new php-common can be installed. This step deletes the original php5 of CentOS.
4. Because the yum source of Linux does not exist for php7.x, we must first change the yum source:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/ epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
After executing the above command, Use: php -v: Display
-bash: php: command not found: It means you need to continue configuring php7.
5. Use: sudo yum list php*: View the currently installed PHP version (the latest version).
You can see that the latest version of PHP that can be installed is: php72w.
6. Install php72w: sudo yum -y install php72w: .
After executing the above command, use: php -v: display
-bash: php: command not found:
Although the version information after the successful installation of PHP7 is not displayed, However, php72w has been successfully installed at this time, and the httpd server needs to be restarted to make the newly installed php72w take effect.
7. After completion, use: systemctl restart httpd.service: Restart httpd.
Use browser: index.php phpinfo(): Test, the php information page will appear, indicating that httpd has been initially fully configured with php72w.
8. Then, in order to solve the problem of using: php -v : command not displaying the php72w version, and to make php72w more robust, we recommend installing the php72 extension:
Extension installation 1:
yum install php72w-common php72w-fpm php72w-opcache php72w-gd php72w-mysqlnd php72w-mbstring php72w-pecl-redis php72w-pecl-memcached php72w-devel
上述命令一共会安装30个拓展包,安装过程较慢,请耐心等待。。。 安装的拓展包如下: php-api, php-bz2, php-calendar, php-ctype, php-curl, php-date, php-exif, php-fileinfo, php-filter, php-ftp, php-gettext, php-gmp, php-hash, php-iconv, php-json, php-libxml, php-openssl, php-pcre, php-pecl-Fileinfo, php-pecl-phar, php-pecl-zip, php-reflection, php-session, php-shmop, php-simplexml, php-sockets, php-spl, php-tokenizer, php-zend-abi, php-zip, php-zlib 执行上述命令后,使用: php -v :显示: PHP 7.2.16 (cli) : 说明php72w开发环境基本安装完成。
9. In order to further strengthen php72w In the development environment, it is recommended to enter the following command to install a more comprehensive expansion package for php72w:
安装包 提供的拓展 php72w mod_php , php72w-zts php72w-bcmath php72w-cli php-cgi, php-pcntl, php-readline php72w-dba php72w-devel php72w-embedded php-embedded-devel php72w-enchant php72w-fpm php72w-gd php72w-imap php72w-interbase php_database, php-firebird php72w-intl php72w-ldap php72w-mbstring php72w-mcrypt php72w-mysql php-mysqli, php_database php72w-mysqlnd php-mysqli, php_database php72w-odbc php-pdo_odbc, php_database php72w-opcache php72w-pecl-zendopcache php72w-pdo php72w-pdo_sqlite, php72w-sqlite3 php72w-pdo_dblib php72w-mssql php72w-pear php72w-pecl-apcu php72w-pecl-imagick php72w-pecl-memcached php72w-pecl-mongodb php72w-pecl-redis php72w-pecl-xdebug php72w-pgsql php-pdo_pgsql, php_database php72w-phpdbg php72w-process php-posix, php-sysvmsg, php-sysvsem, php-sysvshm php72w-pspell php72w-recode php72w-snmp php72w-soap php72w-tidy php72w-xml php-dom, php-domxml, php-wddx, php-xsl php72w-xmlrpc
Each of the above expansion packages is used similarly: yum install php72w-xml: command to install.
Recommended learning: php video tutorial
The above is the detailed content of How to install PHP7 on CentOS78. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo
