当前位置:网站首页>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
边栏推荐
猜你喜欢

防疫登记小程序

Sim Api User Guide(6)

Easy to understand subset DP

Solving Lucas number and combination theorem

论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——5结果

2022年上海市安全员C证考试题库及答案

ABAP 7.4 SQL Window Expression

ABAP implementation publishes restful services for external invocation example

Failureforwardurl and failureurl

元宇宙时代的职业规划与执行
随机推荐
PHP notes (I): development environment configuration
杰理之栈溢出 stackoverflow 怎么办?【篇】
Sim Api User Guide(4)
Planning and construction of industrial meta universe platform
Realize data value through streaming data integration (2)
通过流式数据集成实现数据价值(5)- 流处理
"Gu Yu series" airdrop
Longest common front string
杰理之用户如何最简单的处理事件【篇】
C语言:表达式求值(整型提升、算术转换 ...)
ABAP 7.4 SQL Window Expression
杰理之通常程序异常情况有哪些?【篇】
ansible 云计算 自动化 命令行精简版
NEC红外遥控编码说明
DBA常用SQL语句(1)— 概况信息
Function realization of printing page
Skill point digging
Depth selector
SQL调优系列文章之—SQL调优简介
Redis exception read error on connection solution