当前位置:网站首页>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
边栏推荐
- [hdu6868] absolute math (pusher + Mobius inversion)
- Realize data value through streaming data integration (1)
- GCD of p2257 YY (Mobius inversion)
- P1390 sum of common divisor (Mobius inversion)
- [COCI] Vje š TICA (subset DP)
- Rain produces hundreds of valleys, and all things grow
- 雨生百谷,万物生长
- Sim Api User Guide(7)
- Classic routine: DP problem of a kind of string counting
- DBA常用SQL语句(6)- 日常管理
猜你喜欢
正大国际讲解道琼斯工业指数到底是什么?
Windows安装redis并将redis设置成服务开机自启
实践六 Windows操作系统安全攻防
ARM调试(1):两种在keil中实现printf重定向到串口的方法
[COCI] lattice (dichotomy + tree divide and conquer + string hash)
"Gu Yu series" airdrop
Easy to understand subset DP
[educational codeforces round 80] problem solving Report
从知识传播的维度对比分析元宇宙
0704、ansible----01
随机推荐
Go language practice mode - functional options pattern
使用IDEA开发Spark程序
解决VMware卸载后再安装出现的问题
Interviewer: let's talk about some commonly used PHP functions. Fortunately, I saw this article before the interview
代码源每日一题 div1 (701-707)
Introduction to graph theory -- drawing
SAP pi / PO function operation status monitoring and inspection
SAP pi / PO soap2proxy consumption external WS example
Yarn资源调度器
SQL调优系列文章之—SQL性能方法论
面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章
正大国际讲解道琼斯工业指数到底是什么?
Es aggregation aggregation analysis
Go语言实践模式 - 函数选项模式(Functional Options Pattern)
Go语言实践模式 - 函数选项模式(Functional Options Pattern)
杰理之用户如何最简单的处理事件【篇】
1D / 1D dynamic programming learning summary
[hdu6833] a very easy math problem
通过流式数据集成实现数据价值(5)- 流分析
Odoo 服务器搭建备忘