Centos7.6安装PHP Apache

下载并安装软件包,命令为:

默认安装为PHP5.6需要安装更高版本:https://www.sooele.com/5648.html

~
~
yum install -y httpd php php-fpm php-server php-mysql
将解压后的“upload”中的所有文件,复制到“/var/www/html/”目录。apache默认
cp -R upload/* /var/www/html/ 


将写入权限赋予给其他用户。 
chmod -R 777 /var/www/html 

重启 Apache 服务。 
systemctl restart httpd

 

 

Dependencies Resolved

============================================================================================================================
 Package                      Arch                    Version                                Repository                Size
============================================================================================================================
Installing:
 httpd                        x86_64                  2.4.6-97.el7.centos.5                  updates                  2.7 M
 php                          x86_64                  5.4.16-48.el7                          base                     1.4 M
 php-fpm                      x86_64                  5.4.16-48.el7                          base                     1.4 M
 php-mysql                    x86_64                  5.4.16-48.el7                          base                     102 k
Installing for dependencies:
 apr                          x86_64                  1.4.8-7.el7                            base                     104 k
 apr-util                     x86_64                  1.5.2-6.el7                            base                      92 k
 httpd-tools                  x86_64                  2.4.6-97.el7.centos.5                  updates                   94 k
 libzip                       x86_64                  0.10.1-8.el7                           base                      48 k
 mailcap                      noarch                  2.1.41-2.el7                           base                      31 k
 php-cli                      x86_64                  5.4.16-48.el7                          base                     2.7 M
 php-common                   x86_64                  5.4.16-48.el7                          base                     565 k
 php-pdo                      x86_64                  5.4.16-48.el7                          base                      99 k

Transaction Summary
============================================================================================================================
Install  4 Packages (+8 Dependent packages)

Total download size: 9.3 M
Installed size: 32 M
Downloading packages:
(1/12): apr-util-1.5.2-6.el7.x86_64.rpm                                                              |  92 kB  00:00:00     
(2/12): apr-1.4.8-7.el7.x86_64.rpm                                                                   | 104 kB  00:00:00     
(3/12): libzip-0.10.1-8.el7.x86_64.rpm                                                               |  48 kB  00:00:00     
(4/12): mailcap-2.1.41-2.el7.noarch.rpm                                                              |  31 kB  00:00:00     
(5/12): httpd-tools-2.4.6-97.el7.centos.5.x86_64.rpm                                                 |  94 kB  00:00:00     
(6/12): httpd-2.4.6-97.el7.centos.5.x86_64.rpm                                                       | 2.7 MB  00:00:00     
(7/12): php-cli-5.4.16-48.el7.x86_64.rpm                                                             | 2.7 MB  00:00:00     
(8/12): php-5.4.16-48.el7.x86_64.rpm                                                                 | 1.4 MB  00:00:00     
(9/12): php-common-5.4.16-48.el7.x86_64.rpm                                                          | 565 kB  00:00:00     
(10/12): php-fpm-5.4.16-48.el7.x86_64.rpm                                                            | 1.4 MB  00:00:00     
(11/12): php-mysql-5.4.16-48.el7.x86_64.rpm                                                          | 102 kB  00:00:00     
(12/12): php-pdo-5.4.16-48.el7.x86_64.rpm                                                            |  99 kB  00:00:00     
----------------------------------------------------------------------------------------------------------------------------
Total                                                                                        23 MB/s | 9.3 MB  00:00:00