当前位置:网站首页>lnmp的配置
lnmp的配置
2022-04-23 09:57:00 【wyju】
l 代表linux
n 代表nginx
m 代表mysql
p 代表php
1.安装nginx
1.1这个是安装连接
https://blog.csdn.net/weixin_45955039/article/details/124282533?spm=1001.2014.3001.5501
1.2安装完以后不要启动,修改配置文件
vim /usr/local/nginx/conf/nginx.conf
注释nini,并把48行修改内容如下
index index.php index.html index.htm;

解注释68-74行,并修改73行的内容如下
include fastcgi.conf;

1.3启动ngnix
没有任何输出结果
/usr/local/nginx/sbin/nginx

2.安装mysql,一定要启动mysql
https://blog.csdn.net/weixin_45955039/article/details/123137325?spm=1001.2014.3001.5501
3.安装php
3.1在/data目录下创建一个php目录
[root@slave2 hadoop]# cd /data/
[root@slave2 data]# mkdir php

3.2把php的安装包,上传到php目录里
安装包下载连接
https://mirrors.lzu.edu.cn/centos/7/os/x86_64/Packages/
上传后效果

3.3安装php服务
yum -y install php-*.rpm
3.4查看php状态
systemctl status php-fpm

3.5启动php
systemctl start php-fpm

3.6关闭php
systemctl stop php-fpm
4.编写php脚本,测试是否可以连接
cd /usr/local/nginx/html/
vim test.php
内容如下
<?php
phpinfo();
?>

5.编写php连接数据库脚本,测试是都可以连接数据库
[root@slave2 html]# cd /usr/local/nginx/html/
[root@slave2 html]# vim test02.php
内容如下
<?php
$links=mysql_connect("localhost","root","123456");
if($links){
echo "link db ok!!!";
}
else{
echo "link db no!!!";
}
?>

版权声明
本文为[wyju]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_45955039/article/details/124343948
边栏推荐
- 计算机网络安全实验二|DNS协议漏洞利用实验
- GCD of p2257 YY (Mobius inversion)
- Go语言实践模式 - 函数选项模式(Functional Options Pattern)
- How to use SQL statement union to get another column of another table when the content of a column in a table is empty
- 第三章 启用和调整IM列存储的大小(IM-3.1)
- Juc并发编程06——深入剖析队列同步器AQS源码
- 深度选择器
- failureForwardUrl与failureUrl
- [untitled]
- 论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——5结果
猜你喜欢

面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章

ABAP CDs view with association example

元宇宙时代的职业规划与执行

Construire neuf capacités de fabrication agile à l'ère métacosmique

ABAP 7.4 SQL Window Expression

Nvidia最新三维重建技术Instant-ngp初探

Introduction to sap pi / PO login and basic functions

ARM调试(1):两种在keil中实现printf重定向到串口的方法

How to use SQL statement union to get another column of another table when the content of a column in a table is empty

Sim Api User Guide(4)
随机推荐
Windows安装redis并将redis设置成服务开机自启
SAP excel has completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
构建元宇宙时代敏捷制造的九种能力
Custom login failure handling
自定义登录失败处理
Odoo server setup notes
Compile and debug mysql8 with clion under MacOS x
[educational codeforces round 80] problem solving Report
SAP RFC_ CVI_ EI_ INBOUND_ Main BP master data creation example (Demo customer only)
第一章 Oracle Database In-Memory 相关概念(续)(IM-1.2)
使用IDEA开发Spark程序
Introduction to sap pi / PO login and basic functions
formatTime时间戳格式转换
Nine abilities of agile manufacturing in the era of meta universe
正大国际讲解道琼斯工业指数到底是什么?
[untitled]
通过流式数据集成实现数据价值(5)- 流处理
从知识传播的维度对比分析元宇宙
Skill point digging
理解作用域