1、配置安装资源
yum -y install
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install
https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install
https://rpms.remirepo.net/enterprise/remi-release-7.rpm sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php74
sudo yum update
#启用PHP remi-7.4模块后,即可使用以下命令继续并安装PHP。
这还将安装许多其他软件包,例如Apache和Nginx模块
yum -y install php php-cli php-common php-fpm php-mysql php-cgi php-mbstring php-gd php-process php-mcrypt
php-soap libjpeg* php-pear php-xml php-devel php-memcached
php-redis php-gearman php-pecl-mongodb
yum -y install gearmand libgearman-devel
yum -y install redis memcached
2、设置环境
#要检查已安装的PHP版本,请运行命令。
php -v
#设置开机启动、运行服务:
systemctl enable php-fpm
systemctl start php-fpm
3、http管理
systemctl start httpd #启动apache服务器
systemctl stop httpd #关闭apache服务器
systemctl enable httpd #设置开机自动启动
systemctl status
httpd.service #检查httpd服务状态
4. Apache网站默认路径
默认路径:/var/www/html
配置文件:/etc/httpd/conf/httpd.conf
可以修改WWW启动页面
systemctl restart httpd #重启APACHE服务器
5.PHP 启动页面
echo "" >
/var/www/html/index.php