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!!!";
}
?>

|