脚本宝典收集整理的这篇文章主要介绍了PHP,mysql,nginxunx中安装,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
1 linux装软件方式: 2 1.源码安装:下载wget--》解压tar -zxvf --》配置 ./configure ---》编译make 3 -->安装 make install 4 2.yum安装 一键安装包 centos 红帽 乌班图 5 3.rpm 6 7 l n m p 8 9 linux 版本 39.98.47.141 10 windows 11 12 centos 6.5 6.8 system nekwrok restart 13 centos 7.0+ systemctl 14 15 centos 7.4 7.5 16 17 systemctl status firewalld.service 查看防火墙 18 systemctl stop firewalld.service 19 systemctl disable firewalld.service 开机 防火墙 不自启 20 21 ###Nginx#######安装篇############ 22 rpm -ivh http://Nginx.org/packages/centos/7/noarch/RPMS/Nginx-release-centos-7-0.el7.ngx.noArch.rpm 23 yum list Nginx ##查询更新列表 24 yum -y install Nginx ##yum安装命令 25 26 systemctl start Nginx.service ##开启Nginx服务软件 27 systemctl enable Nginx.service ##加入开启启动项 28 29 ###Nginx#######测试篇###################### 30 用windows浏览器 测试 31 http://39.98.47.141/(阿里云IP) 32 看到: 33 Welcome to Nginx! 34 表示: 35 Nginx安装成功了 36 问题1: 访问不了 37 阿里云: 安全组 --》配置 --》 克隆一个 端口 80 38 ########################################### 39 40 ===========================================接》》着》》安装》》PHP》》=================================================》》》》 41 42 43 ###PHP56#######安装篇############ 44 rpm -Uvh https://dl.FedoraPRoject.org/pub/EPEL/ePEl-release-latest-7.noarch.rpm 45 rpm -Uvh https://mirror.weBTatic.COM/yum/el7/webtatic-release.rpm 46 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 49 systemctl start PHP-fpm.service ## 启动 PHP-fpm 软件 用于 运行PHP脚本 50 systemctl enable PHP-fpm.service ## 加入 PHP-fpm 开启自动项 51 52 /etc/Nginx/conf.d/ 目录下: 虚拟机配置文件 53 54 Nginx.conf 55 include 56 57 vim /etc/Nginx/conf.d/default.conf 58 59 :set nu #####开启行数 60 ###将30行-36行 前面 # 去掉 61 ###将 第31行 "html" 改成 /usr/share/Nginx/html 62 ###将 第34行 "/scripts" 改成 $document_root 63 64 location ~ \.PHP$ { 65 root /usr/share/Nginx/html; 66 fastcgi_pass 127.0.0.1:9000; 67 fastcgi_index index.PHP; 68 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_SCRIPT_NAME; 69 include fastcgi_params; 70 } 71 72 :wq! ##退出保存 73 74 systemctl restart Nginx.service 75 systemctl restart PHP-fpm.service 76 77 vim /usr/share/Nginx/html/index.PHP 78 ###编辑如下代码 测试环境脚本 79 <?PHP 80 echo PHPinfo(); 81 ?> 82 83 84 ###Nginx关联PHP脚本#######测试篇###################### 85 用windows浏览器 测试 86 http://39.107.105.231/index.PHP (阿里云IP) 87 看到: 88 PHP Version 5.6.36 89 表示: 90 Nginx关联PHP成功了,也就是PHP安装成功了! 91 ##################################################### 92 93 ===========================================接》》着》》安装》》MysqL》》=================================================》》》》 94 95 ###MysqL#######安装篇############ 96 rpm -qa|grep mariadb #查看阿里云默认安装的mariadb数据库 版本号:如:mariadb-libs-5.5.56-2.el7.x86_64 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 99 rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64 100 101 102 rpm -ivh http://dev.MysqL.com/get/MysqL-commUnity-release-el7-5.noarch.rpm 103 yum list MysqL-communITy-server 104 yum -y install MysqL-community-server 105 106 systemctl start MysqLd.service 107 systemctl enable MysqLd.service 108 109 MysqL_secure_installation ###初始化 MysqL系统数据(安装系统数据库) 110 111 ##提示: Enter current password for root (enter for none): 112 空密码,回车 113 114 ##提示: Set root password? [Y/n] 115 y,回车 116 117 ##提示: New password: 118 输入数据库密码,如:zha123456 (两次重复密码) 119 120 ##提示: Remove anonymous users? [Y/n] 121 y,回车 122 123 ##提示: Disallow root login remotely? [Y/n] 124 y,回车 125 126 ##提示: Remove test database and access to it? [Y/n] 127 y,回车 128 129 ##提示: Reload privilege tables Now? [Y/n] 130 y,回车 131 132 ###提示: 看到: 133 Thanks for using MysqL! 134 135 136 MysqL -h localhost -u root -p 137 Enter password:******** rootroot 138 139 MysqL> 140 MysqL>GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘zha123456‘ WITH GRANT OPTION; ##开启MysqL远程访问权限 141 MysqL>flush privileges; ##刷新权限 142 MysqL>exit; 143 144 systemctl stop firewalld.service 145 146 ###MysqL#######测试篇###################### 147 ###提示: 阿里云 安全组 克隆规则 148 允许 自定义 TCP 3306/3306 地址段访问 0.0.0.0/0 System created rule. 149 用Navicat for MysqL 新建连接测试 150 表示: 151 Navicat for MysqL 连接阿里云Ip数据库, 152 外网访问正常,ok!! 153 ##################################################### 154 155 ===========================================接》》着》》安装》》Iwebshop》》=================================================》》》》 156 157 上传iwebshop压缩包: 158 FileZilla: 159 160 unzip iwebshop.zip 161 162 vim /etc/selinux/config
以上是脚本宝典为你收集整理的PHP,mysql,nginxunx中安装全部内容,希望文章能够帮你解决PHP,mysql,nginxunx中安装所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。