当前位置:网站首页>Configuration of LNMP
Configuration of LNMP
2022-04-23 10:03:00 【wyju】
l representative linux
n representative nginx
m representative mysql
p representative php
1. install nginx
1.1 This is the installation connection
https://blog.csdn.net/weixin_45955039/article/details/124282533?spm=1001.2014.3001.5501
1.2 Do not start after installation , Modify the configuration file
vim /usr/local/nginx/conf/nginx.conf
notes nini, And put 48 The line is modified as follows
index index.php index.html index.htm;

Uncomment 68-74 That's ok , And modify it 73 The content of the line is as follows
include fastcgi.conf;

1.3 start-up ngnix
No output
/usr/local/nginx/sbin/nginx

2. install mysql, Be sure to start mysql
https://blog.csdn.net/weixin_45955039/article/details/123137325?spm=1001.2014.3001.5501
3. install php
3.1 stay /data Create one in the directory php Catalog
[root@slave2 hadoop]# cd /data/
[root@slave2 data]# mkdir php

3.2 hold php Installation package , Upload to php Directory
Install package download connection
https://mirrors.lzu.edu.cn/centos/7/os/x86_64/Packages/
Post upload effect

3.3 install php service
yum -y install php-*.rpm
3.4 see php state
systemctl status php-fpm

3.5 start-up php
systemctl start php-fpm

3.6 close php
systemctl stop php-fpm
4. To write php Script , Test if you can connect
cd /usr/local/nginx/html/
vim test.php
The contents are as follows
<?php
phpinfo();
?>

5. To write php Connect database script , The test is that you can connect to the database
[root@slave2 html]# cd /usr/local/nginx/html/
[root@slave2 html]# vim test02.php
The contents are as follows
<?php
$links=mysql_connect("localhost","root","123456");
if($links){
echo "link db ok!!!";
}
else{
echo "link db no!!!";
}
?>

版权声明
本文为[wyju]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230956570727.html
边栏推荐
猜你喜欢
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

Comparative analysis of meta universe from the dimension of knowledge dissemination

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

Planning and construction of industrial meta universe platform

0704、ansible----01

【无标题】
![[educational codeforces round 80] problem solving Report](/img/54/2fd298ddce3cd3e28a8fe42b3b8a42.png)
[educational codeforces round 80] problem solving Report

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

Windows安装redis并将redis设置成服务开机自启

2022年上海市安全员C证考试题库及答案
随机推荐
Solving Lucas number and combination theorem
通过流式数据集成实现数据价值(2)
Cloud identity is too loose, opening the door for attackers
第三章 启用和调整IM列存储的大小(IM-3.1)
ARM调试(1):两种在keil中实现printf重定向到串口的方法
NEC infrared remote control coding description
[COCI] Vje š TICA (subset DP)
Chinese Remainder Theorem and extended Chinese remainder theorem that can be understood by Aunt Baojie
"Gu Yu series" airdrop
Mobius inversion
Using idea to develop Spark Program
杰理之通常程序异常情况有哪些?【篇】
面试官:说几个PHP常用函数,幸好我面试之前看到了这篇文章
[untitled]
DBA常用SQL语句(3)- cache、undo、索引和等待事件
[codeforces - 208e] blood cousins
Construire neuf capacités de fabrication agile à l'ère métacosmique
DBA常用SQL语句(6)- 日常管理
Pyqt5与通信
Go language practice mode - functional options pattern