(openEuler21.03-Centos7-x86)yum安装php+apache

简介: 记(openEuler21.03-Centos7-x86)yum安装php+apache
#关闭防火墙和 selinux 并重启
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
systemctl disable --now firewalld
#openEuler需要配源
vim /etc/yum.repos.d/openEuler.repo
[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/everything/$basearch/RPM-GPG-KEY-openEuler
[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-21.03/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler
[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/debuginfo/$basearch/RPM-GPG-KEY-openEuler
[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-21.03/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/source/RPM-GPG-KEY-openEuler
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-21.03/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.03/OS/$basearch/RPM-GPG-KEY-openEuler

图片.png

安装php

#安装PHP 
#centos7
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum -y install php  php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis
yum-config-manager --enable remi-php74
#openEuler
yum list php
yum -y install php
#查看版本
php -v
#查看启动模块
php --modules
#查看安装路径
whereis php

图片.png

#启动,自启,查看运行状态
service php-fpm start
service php-fpm enable
service php-fpm status

图片.png

安装apache

#安装httpd
yum install httpd -y
systemctl restart httpd
systemctl enable httpd
#配置文件
/etc/httpd/conf/httpd.conf
/var/www/html
#配置Apache解析PHP
vim /etc/httpd/conf.d/php-fpm.conf
<FilesMatch \.php$>
        SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
#Apache网页目录下编写简单的php网页,验证访问Apache的php网页
vim /var/www/html/index.php
<?php
 phpinfo();
?>
#浏览器访问
http://IP/index.php

图片.png

目录
相关文章
|
3月前
|
Linux PHP Apache
centos7安装php8
centos7安装php8
289 1
QGS
|
Apache PHP
(openEuler21.03-Centos7-x86)yum安装php+apache
记(openEuler21.03-Centos7-x86)yum安装php+apache
QGS
297 0
(openEuler21.03-Centos7-x86)yum安装php+apache
|
Linux PHP 弹性计算
阿里云 CentOS 7.3 安装 PHP7.2
虽然阿里云服务器ECS中的CentOS系统的默认源已经改为了阿里的mirror,但是如果直接使用命令 yum -y install php 安装的版本却不是php7。下文带你用最简单,最快的方式安装php7。
5636 0
|
Linux PHP
CentOS7.4 通过yum安装php7.0
一、删除旧版本 如果已经安装过php就先删除之前的版本。检查方法如下: yum list installed | grep php 然后将安装的包进行删除 比如 yum remove php.
1595 0
|
Linux PHP
|
Linux PHP Apache
CentOS7.X安装php-7.x.x
CentOS7.X安装php-7.x.x
3143 0
|
Web App开发 测试技术 应用服务中间件
Centos 6.x/7.x yum安装php5.6.X
  Centos 6.x/7.x yum安装php5.6.X(最新版) [+] 鉴于Centos 默认yum源的php版本太低了,手动编译安装又有点一些麻烦,那么如何采用Yum安装的方案安装最新版呢。
1429 0
下一篇
无影云桌面