(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

目录
相关文章
|
2月前
|
Linux PHP Apache
centos7安装php8
centos7安装php8
171 0
|
5月前
|
PHP Apache
centos7.9 安装php7.0以上版本
centos7.9 安装php7.0以上版本
265 2
QGS
|
Apache PHP
(openEuler21.03-Centos7-x86)yum安装php+apache
记(openEuler21.03-Centos7-x86)yum安装php+apache
QGS
276 0
(openEuler21.03-Centos7-x86)yum安装php+apache
|
Linux PHP 弹性计算
阿里云 CentOS 7.3 安装 PHP7.2
虽然阿里云服务器ECS中的CentOS系统的默认源已经改为了阿里的mirror,但是如果直接使用命令 yum -y install php 安装的版本却不是php7。下文带你用最简单,最快的方式安装php7。
5605 0
|
Linux PHP
|
Linux Apache 弹性计算
|
Linux PHP Apache
CentOS7.X安装php-7.x.x
CentOS7.X安装php-7.x.x
3134 0
|
Apache 数据安全/隐私保护 Linux
Centos 7 安装Apache httpd
首选,登录您的服务器。输入账号和密码登录后。 1、安装Apache(输入下面命令)yum -y install httpd 2、等待安装完成后,输入启动命令systemctl start httpd 3.
1949 0
下一篇
无影云桌面