随笔 - 192  文章 - 0  评论 - 14  阅读 - 24万

CentOS-7部署PHP-7.4

CentOS-7部署PHP-7.4

使用CentOS-7-x86_64-Minimal-2009.iso安装

一、常用操作

1:关闭防火墙

service firewalld stop
systemctl disable firewalld

2:启用登录密钥

mkdir -p ~/.ssh&&echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINczVrP1nQt56KrtY0zFDRYvNGjMVS2MphwNWXH5j7yg xixi-ed25519-20240206'>>~/.ssh/authorized_keys

3:下载常用工具

yum install tmux wget

4:关闭SELinux

setenforce 0

vi /etc/selinux/config

SELINUX=permissive

二、PHP-FPM服务

1:安装php7.4

yum install epel-release
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum --enablerepo=remi install php74-php-fpm php74-php-mysqli php74-php-redis php74-php-xml php74-php-mbstring php74-php-intl
systemctl enable php74-php-fpm

(rpm -ivh remi-release-7.rpm依赖epel-release)

2:配置文件

vi /etc/opt/remi/php74/php-fpm.d/www.conf

;listen = /run/php-fpm/www.sock
listen = 127.0.0.1:9000

3:重启FPM服务

service php74-php-fpm restart

三、NGINX服务器

1:安装NGINX

yum install epel-release
yum install nginx
systemctl enable nginx
service nginx restart

(yum install nginx依赖epel-release)

或者可以直接指定包

yum install pcre2
wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.24.0-1.el7.ngx.x86_64.rpm
rpm -ivh nginx-1.24.0-1.el7.ngx.x86_64.rpm
systemctl enable nginx
service nginx restart

四、MySQL-8.0服务器

yum remove -y mariadb-libs
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-common-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-plugins-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-libs-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-client-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-icu-data-files-8.0.36-1.el7.x86_64.rpm
yum install -y https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server-8.0.36-1.el7.x86_64.rpm
systemctl enable mysqld
service mysqld restart

五、Redis服务器

yum install redis
systemctl enable redis
vi /etc/redis.conf
requirepass your_password
service redis restart

六、SVN服务器

yum install subversion
systemctl enable svnserve

vi /etc/sysconfig/svnserve

OPTIONS="-r /var/svn"
service svnserve restart
posted on   项希盛  阅读(193)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示