PHP,mysql,nginxunx中安装

一:安装PHP,mysql,nginx

1 1 linux装软件方式: 2 2 1.源码安装:下载wget--》解压tar -zxvf --》配置 ./configure ---》编译make 3 3 -->安装 make install 4 4 2.yum安装 一键安装包 centos 红帽 乌班图 5 5 3.rpm 6 6 7 7 l n m p 8 8 9 9 linux 版本 39.98.47.141 10 10 windows 11 11 12 12 centos 6.5 6.8 system nekwrok restart 13 13 centos 7.0+ systemctl 14 14 15 15 centos 7.4 7.5 16 16 17 17 systemctl status firewalld.service 查看防火墙 18 18 systemctl stop firewalld.service 19 19 systemctl disable firewalld.service 开机 防火墙 不自启 20 20 21 21 ###Nginx#######安装篇############ 22 22 rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 23 23 yum list nginx ##查询更新列表 24 24 yum -y install nginx ##yum安装命令 25 25 26 26 systemctl start nginx.service ##开启nginx服务软件 27 27 systemctl enable nginx.service ##加入开启启动项 28 28 29 29 ###Nginx#######测试篇###################### 30 30 用windows浏览器 测试 31 31 http://39.98.47.141/(阿里云IP) 32 32 看到: 33 33 Welcome to nginx! 34 34 表示: 35 35 Nginx安装成功了 36 36 问题1: 访问不了 37 37 阿里云: 安全组 --》配置 --》 克隆一个 端口 80 38 38 ########################################### 39 39 40 40 ===========================================接》》着》》安装》》PHP》》=================================================》》》》 41 41 42 42 43 43 ###Php56#######安装篇############ 44 44 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 45 45 rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 46 46 47 47 yum -y install php56w php56w-fpm php56w-opcache php56w-mysql php56w-gd libjpeg* php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mbstring php56w-bcmath 48 48 49 49 systemctl start php-fpm.service ## 启动 php-fpm 软件 用于 运行PHP脚本 50 50 systemctl enable php-fpm.service ## 加入 php-fpm 开启自动项 51 51 52 52 /etc/nginx/conf.d/ 目录下: 虚拟机配置文件 53 53 54 54 nginx.conf 55 55 include 56 56 57 57 vim /etc/nginx/conf.d/default.conf 58 58 59 59 :set nu #####开启行数 60 60 ###将30-36行 前面 # 去掉 61 61 ###将 第31"html" 改成 /usr/share/nginx/html 62 62 ###将 第34"/scripts" 改成 $document_root 63 63 64 64 location ~ \.php$ { 65 65 root /usr/share/nginx/html; 66 66 fastcgi_pass 127.0.0.1:9000; 67 67 fastcgi_index index.php; 68 68 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 69 69 include fastcgi_params; 70 70 } 71 71 72 72 :wq! ##退出保存 73 73 74 74 systemctl restart nginx.service 75 75 systemctl restart php-fpm.service 76 76 77 77 vim /usr/share/nginx/html/index.php 78 78 ###编辑如下代码 测试环境脚本 79 79 <?php 80 80 echo phpinfo(); 81 81 ?> 82 82 83 83 84 84 ###Nginx关联php脚本#######测试篇###################### 85 85 用windows浏览器 测试 86 86 http://39.107.105.231/index.php (阿里云IP) 87 87 看到: 88 88 PHP Version 5.6.36 89 89 表示: 90 90 Nginx关联php成功了,也就是PHP安装成功了! 91 91 ##################################################### 92 92 93 93 ===========================================接》》着》》安装》》MySQL》》=================================================》》》》 94 94 95 95 ###Mysql#######安装篇############ 96 96 rpm -qa|grep mariadb #查看阿里云默认安装的mariadb数据库 版本号:如:mariadb-libs-5.5.56-2.el7.x86_64 97 97 rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64 ##卸载mariadb-libs-5.5.56-2.el7.x86_64包 (rpm -e --nodeps 后面跟是上个命令查询结果) 98 98 99 99 rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64 100100 101101 102102 rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 103103 yum list mysql-community-server 104104 yum -y install mysql-community-server 105105 106106 systemctl start mysqld.service 107107 systemctl enable mysqld.service 108108 109109 mysql_secure_installation ###初始化 mysql系统数据(安装系统数据库) 110110 111111 ##提示: Enter current password for root (enter for none): 112112 空密码,回车 113113 114114 ##提示: Set root password? [Y/n] 115115 y,回车 116116 117117 ##提示: New password: 118118 输入数据库密码,如:zha123456 (两次重复密码) 119119 120120 ##提示: Remove anonymous users? [Y/n] 121121 y,回车 122122 123123 ##提示: Disallow root login remotely? [Y/n] 124124 y,回车 125125 126126 ##提示: Remove test database and access to it? [Y/n] 127127 y,回车 128128 129129 ##提示: Reload privilege tables now? [Y/n] 130130 y,回车 131131 132132 ###提示: 看到: 133133 Thanks for using MySQL! 134134 135135 136136 mysql -h localhost -u root -p 137137 Enter password:******** rootroot 138138 139139 mysql> 140140 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'zha123456' WITH GRANT OPTION; ##开启mysql远程访问权限 141141 mysql>flush privileges; ##刷新权限 142142 mysql>exit; 143143 144144 systemctl stop firewalld.service 145145 146146 ###MySQL#######测试篇###################### 147147 ###提示: 阿里云 安全组 克隆规则 148148 允许 自定义 TCP 3306/3306 地址段访问 0.0.0.0/0 System created rule. 149149 用Navicat for MySQL 新建连接测试 150150 表示: 151151 Navicat for MySQL 连接阿里云Ip数据库, 152152 外网访问正常,ok!153153 ##################################################### 154154 155155 ===========================================接》》着》》安装》》Iwebshop》》=================================================》》》》 156156 157157 上传iwebshop压缩包: 158158 FileZilla: 159159 160160 unzip iwebshop.zip 161161 162162 vim /etc/selinux/config
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )

KVM调整cpu和内存

一.修改kvm虚拟机的配置1、virsheditcentos7找到“memory”和“vcpu”标签,将<namecentos7</name<uuid2220a6d1a36a4fbb8523e078b3dfe795</uuid

PHP,mysql,nginxunx中安装 - HelloWorld