当前位置:首页 > 技术记录 > 正文内容

centos7.0 安装php mysql nginx 环境

ogfogf5年前 (2021-02-20)技术记录2162

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

yum install epel-release

yum update

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install -y php php-devel php-fpm php-mysql php-common php-devel php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel mod_ssl mod_perl curl curl-devel nginx mariadb mariadb-server php-redis

/usr/share/nginx/html

systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止
systemctl restart nginx.service #重启
systemctl enable nginx.service #设置开机启动

systemctl start php-fpm.service #启动php-fpm
systemctl enable php-fpm.service #设置开机启动
yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装,直到安装完成
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
mysqladmin -u root password ‘123456’; #设置数据库密码
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}


扫描二维码推送至手机访问。

版权声明:本文由技术建站文档发布,如需转载请注明出处。

分享给朋友:

相关文章

JS使用H5实现图片预览

JS使用H5实现图片预览

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>文件上传...

ajax实现跨域访问

ajax实现跨域访问

ajax跨域访问是一个老生畅谈的问题啦,网上解决方法很多,discuz用的p3p协议,有兴趣的朋友可以了解下,比较常用的是JSONP方法,貌似目前这种方法只支持GET方式,不如POST方式安全。即使使...

php7.2兼容thinkphp3.2,thinkphp3.2升级php7.2要点记录

有一台老服务器到期了,新升级的系统,再安装旧版本的php环境,多少有点麻烦。毕竟php5 已经被官方放弃有一段时间了,php7 也已经发布使用了很长时间。由于php7相对于php5,升级改动的地方很多...

linux 安装 ffmpeg

linux 安装 ffmpeg

https://blog.csdn.net/u013416034/article/details/130649958windows上安装,直接下载压缩包解压。linux安装,找了半天各种技术文章,说最...

A股各细分行业龙头

锂电池各类细分1.电池:宁德时代、比亚迪、亿纬锂能、国轩高科、鹏辉能源、川能动力、欣旺达。2.正极材料:a.三元正极:容百科技、当升科技、杉杉能源(杉杉股份 )、格林美、中伟股份、厦钨新能(厦门钨业...

yum php mysql nginx

systemctl stop firewalld.service #停止firewall   systemctl disable firewalld.service #禁止fire...