越简单越好!

AnolisOS8.9安装PHP环境

发表于 2025-04-04 12:18 | 12次阅读 0次点赞   Anolis

1. 最小化安装

2. 配置基本信息

hostnamectl set-hostname test.dev


为了每次系统重新启动时,都可以获取更大的ulimit值,将ulimit 加入到/etc/profile 文件底部。 

echo ulimit -n 65535 >>/etc/profile 

source /etc/profile

ulimit -n     #显示65535,修改完毕!


3. 关闭SELinux

SELinux的工作模式一共有三种 enforcing、permissive和disabled 

①enforcing  强制模式:只要是违反策略的行动都会被禁止,并作为内核信息记录

②permissive  允许模式:违反策略的行动不会被禁止,但是会提示警告信息

③disabled  禁用模式:禁用SELinux,与不带SELinux系统是一样的,通常情况下我们在不怎么了解SELinux时,将模式设置成disabled,这样在访问一些网络应用时就不会出问题了。

getenforce 查看当前模式

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

设置后需要重启才能生效


4. 安装软件

dnf -y install epel-release

dnf -y install gcc gcc-c++ gdb net-tools telnet libevent-devel unzip bind-utils wget sysstat git liblzf


5. 安装PHP

wget http://rpms.famillecollet.com/enterprise/remi-release-8.rpm

 

rpm -ivh remi-release-8.rpm --nodeps --force

rpm -qa | grep remi

dnf module list php

dnf module enable php:remi-8.4



dnf -y install php php-fpm php-mbstring php-pdo php-gd php-mysql php-redis php-devel php-xml php-mcrypt php-cli


返回顶部 ^