在 Debian 上启动 LNMP(Linux + Nginx + MySQL/MariaDB + PHP),一般按下面步骤来。假设你是用 apt 安装的标准 LNMP 环境。
sudo systemctl start nginx
设置开机自启:
sudo systemctl enable nginx
查看状态:
sudo systemctl status nginx
Debian 默认可能是 MariaDB:
sudo systemctl start mariadb
或
sudo systemctl start mysql
开机自启:
sudo systemctl enable mariadb
查看状态:
sudo systemctl status mariadb
PHP 一般通过 php-fpm 运行(如 PHP 8.2):
sudo systemctl start php8.2-fpm
开机自启:
sudo systemctl enable php8.2-fpm
查看状态:
sudo systemctl status php8.2-fpm
如果你不确定 PHP 版本,可用:
php -v
sudo systemctl start nginx mariadb php8.2-fpm
http://你的服务器IP
sudo nano /var/www/html/info.php
写入:
<?php phpinfo(); ?>
访问:
http://你的服务器IP/info.php
lnmp start
如果你能告诉我:
我可以给你更精确的命令。