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

Depth selector

论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——3背景

SAP 03-amdp CDs table function using 'with' clause

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

The sap export excel file opens and shows that the file format and extension of "XXX" do not match. The file may be damaged or unsafe. Do not open it unless you trust its source. Do you still want to

杰理之更准确地确定异常地址【篇】

Number theory blocking (integer division blocking)

SAP debug debug for in, reduce and other complex statements
MapReduce核心和基础Demo

2022茶艺师(初级)考试试题模拟考试平台操作
随机推荐
云身份过于宽松,为攻击者打开了大门
从知识传播的维度对比分析元宇宙
Golang force buckle leetcode 396 Rotation function
第二章 In-Memory 体系结构 (IM-2.2)
ABAP implementation publishes restful services for external invocation example
Code source daily question div1 (701-707)
AI上推荐 之 MMOE(多任务yyds)
Planning and construction of industrial meta universe platform
P1446 [hnoi2008] cards (Burnside theorem + DP count)
论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》——3背景
杰理之通常影响CPU性能测试结果的因素有:【篇】
杰理之有时候定位到对应地址的函数不准确怎么办?【篇】
SAP pi / PO function operation status monitoring and inspection
Sim Api User Guide(5)
[2020wc Day2] F. Clarice picking mushrooms (subtree and query, light and heavy son thought)
Sim Api User Guide(8)
"Gu Yu series" airdrop
DBA常用SQL语句(4)- Top SQL
GCD of p2257 YY (Mobius inversion)
杰理之更准确地确定异常地址【篇】