LNMP安装笔记
安装Nginx
1 | # apt update |
控制服务状态
1 | # systemctl start nginx |
安装MariaDB
1 | # apt install mariadb-server |
安全配置全部Yes
1 | # mysql_secure_installation |
安装PHP-FPM (Fast Process Manager)
1 | # apt install php-fpm php-mysqli |
查看启动状态
1 | # systemctl status php7.3-fpm |
修改PHP-FPM配置文件/etc/php/7.3/fpm/php.ini
取消如下内容的注释,并改为0
1 | cgi.fix_pathinfo=0 |
修改Nginx配置文件/etc/nginx/sites-available/default
取消如下内容的注释
1 | location ~ \.php$ { |
同时添加主页index.php
重启服务
1 | # systemctl restart php7.3-fpm |
在/var/www/html/
下编写测试页
1 | <?php phpinfo(); ?> |
测试正常后继续
下载phpMyAdmin,并解压到/var/www/html/
目录下
进入mysql命令行创建phpmyadmin用户
1 | CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'password'; |
使用phpmyadmin登录成功即可
引用
https://www.tecmint.com/install-lemp-on-debian-10-server/
https://www.centos.bz/2017/07/mysql5-7-phpmyadmin-access-denied-for-user-rootlocalhost/